﻿(function(n) {
    "use strict";

    function t(t) {
        var i = n("");
        try {
            i = n(t).clone()
        } catch (r) {
            i = n("<span />").html(t)
        }
        return i
    }

    function i(n) {
        return !!(typeof Node == "object" ? n instanceof Node : n && typeof n == "object" && typeof n.nodeType == "number" && typeof n.nodeName == "string")
    }
    n.print = n.fn.print = function() {
        var u, e, s = this,
            v, o, f, c, r, l, h, a;
        if (s instanceof n && (s = s.get(0)), i(s) ? (e = n(s), arguments.length > 0 && (u = arguments[0])) : arguments.length > 0 ? (e = n(arguments[0]), i(e[0]) ? arguments.length > 1 && (u = arguments[1]) : (u = arguments[0], e = n("html"))) : e = n("html"), v = {
                globalStyles: !0,
                mediaPrint: !1,
                stylesheet: null,
                noPrintSelector: ".no-print",
                iframe: !0,
                append: null,
                prepend: null
            }, u = n.extend({}, v, u || {}), o = n(""), u.globalStyles ? o = n("style, link, meta, title") : u.mediaPrint && (o = n("link[media=print]")), u.stylesheet && (o = n.merge(o, n('<link rel="stylesheet" href="' + u.stylesheet + '">'))), f = e.clone(), f = n("<span/>").append(f), f.find(u.noPrintSelector).remove(), f.append(o.clone()), f.append(t(u.append)), f.prepend(t(u.prepend)), c = f.html(), f.remove(), u.iframe) try {
            h = n(u.iframe + "");
            a = h.length;
            a === 0 && (h = n('<iframe height="0" width="0" border="0" wmode="Opaque"/>').prependTo("body").css({
                position: "absolute",
                top: -999,
                left: -999
            }));
            r = h.get(0);
            r = r.contentWindow || r.contentDocument || r;
            l = r.document || r.contentDocument || r;
            l.open();
            l.write(c);
            l.close();
            setTimeout(function() {
                r.focus();
                r.print();
                setTimeout(function() {
                    a === 0 && h.remove()
                }, 100)
            }, 250)
        } catch (y) {
            console.error("Failed to print from iframe", y.stack, y.message);
            r = window.open();
            r.document.write(c);
            r.document.close();
            r.focus();
            r.print();
            r.close()
        } else r = window.open(), r.document.write(c), r.document.close(), r.focus(), r.print(), r.close();
        return this
    }
})(jQuery);
! function(n, t, i) {
    var e = n.L,
        r = {},
        u, f;
    r.version = "0.7.2";
    "object" == typeof module && "object" == typeof module.exports ? module.exports = r : "function" == typeof define && define.amd && define(r);
    r.noConflict = function() {
        return n.L = e, this
    };
    n.L = r;
    r.Util = {
            extend: function(n) {
                for (var t, r, f = Array.prototype.slice.call(arguments, 1), i = 0, u = f.length; u > i; i++) {
                    r = f[i] || {};
                    for (t in r) r.hasOwnProperty(t) && (n[t] = r[t])
                }
                return n
            },
            bind: function(n, t) {
                var i = arguments.length > 2 ? Array.prototype.slice.call(arguments, 2) : null;
                return function() {
                    return n.apply(t, i || arguments)
                }
            },
            stamp: function() {
                var t = 0,
                    n = "_tmap_id";
                return function(i) {
                    return i[n] = i[n] || ++t, i[n]
                }
            }(),
            invokeEach: function(n, t, i) {
                var r, u;
                if ("object" == typeof n) {
                    u = Array.prototype.slice.call(arguments, 3);
                    for (r in n) t.apply(i, [r, n[r]].concat(u));
                    return !0
                }
                return !1
            },
            limitExecByInterval: function(n, t, i) {
                var r, u;
                return function f() {
                    var e = arguments;
                    return r ? void(u = !0) : (r = !0, setTimeout(function() {
                        r = !1;
                        u && (f.apply(i, e), u = !1)
                    }, t), void n.apply(i, e))
                }
            },
            falseFn: function() {
                return !1
            },
            formatNum: function(n, t) {
                var i = Math.pow(10, t || 5);
                return Math.round(n * i) / i
            },
            trim: function(n) {
                return n.trim ? n.trim() : n.replace(/^\s+|\s+$/g, "")
            },
            splitWords: function(n) {
                return r.Util.trim(n).split(/\s+/)
            },
            setOptions: function(n, t) {
                return n.options = r.extend({}, n.options, t), n.options
            },
            getParamString: function(n, t, i) {
                var u = [],
                    r;
                for (r in n) u.push(encodeURIComponent(i ? r.toUpperCase() : r) + "=" + encodeURIComponent(n[r]));
                return (t && -1 !== t.indexOf("?") ? "&" : "?") + u.join("&")
            },
            template: function(n, t) {
                return n.replace(/\{ *([\w_]+) *\}/g, function(n, r) {
                    var u = t[r];
                    if (u === i) throw new Error("No value provided for variable " + n);
                    return "function" == typeof u && (u = u(t)), u
                })
            },
            isArray: Array.isArray || function(n) {
                return "[object Array]" === Object.prototype.toString.call(n)
            },
            emptyImageUrl: ""
        },
        function() {
            function t(t) {
                for (var r, u = ["webkit", "moz", "o", "ms"], i = 0; i < u.length && !r; i++) r = n[u[i] + t];
                return r
            }

            function i(t) {
                var i = +new Date,
                    r = Math.max(0, 16 - (i - u));
                return u = i + r, n.setTimeout(t, r)
            }
            var u = 0,
                f = n.requestAnimationFrame || t("RequestAnimationFrame") || i,
                e = n.cancelAnimationFrame || t("CancelAnimationFrame") || t("CancelRequestAnimationFrame") || function(t) {
                    n.clearTimeout(t)
                };
            r.Util.requestAnimFrame = function(t, u, e, o) {
                return t = r.bind(t, u), e && f === i ? void t() : f.call(n, t, o)
            };
            r.Util.cancelAnimFrame = function(t) {
                t && e.call(n, t)
            }
        }();
    r.extend = r.Util.extend;
    r.bind = r.Util.bind;
    r.stamp = r.Util.stamp;
    r.setOptions = r.Util.setOptions;
    r.Class = function() {};
    r.Class.extend = function(n) {
        var i = function() {
                this.initialize && this.initialize.apply(this, arguments);
                this._initHooks && this.callInitHooks()
            },
            e = function() {},
            t, u, f;
        e.prototype = this.prototype;
        t = new e;
        t.constructor = i;
        i.prototype = t;
        for (u in this) this.hasOwnProperty(u) && "prototype" !== u && (i[u] = this[u]);
        return n.statics && (r.extend(i, n.statics), delete n.statics), n.includes && (r.Util.extend.apply(null, [t].concat(n.includes)), delete n.includes), n.options && t.options && (n.options = r.extend({}, t.options, n.options)), r.extend(t, n), t._initHooks = [], f = this, i.__super__ = f.prototype, t.callInitHooks = function() {
            if (!this._initHooksCalled) {
                f.prototype.callInitHooks && f.prototype.callInitHooks.call(this);
                this._initHooksCalled = !0;
                for (var n = 0, i = t._initHooks.length; i > n; n++) t._initHooks[n].call(this)
            }
        }, i
    };
    r.Class.include = function(n) {
        r.extend(this.prototype, n)
    };
    r.Class.mergeOptions = function(n) {
        r.extend(this.prototype.options, n)
    };
    r.Class.addInitHook = function(n) {
        var t = Array.prototype.slice.call(arguments, 1),
            i = "function" == typeof n ? n : function() {
                this[n].apply(this, t)
            };
        this.prototype._initHooks = this.prototype._initHooks || [];
        this.prototype._initHooks.push(i)
    };
    u = "_tmap_events";
    r.Mixin = {};
    r.Mixin.Events = {
        addEventListener: function(n, t, i) {
            if (r.Util.invokeEach(n, this.addEventListener, this, t, i)) return this;
            var o, v, l, e, s, a, h, f = this[u] = this[u] || {},
                c = i && i !== this && r.stamp(i);
            for (n = r.Util.splitWords(n), o = 0, v = n.length; v > o; o++) l = {
                action: t,
                context: i || this
            }, e = n[o], c ? (s = e + "_idx", a = s + "_len", h = f[s] = f[s] || {}, h[c] || (h[c] = [], f[a] = (f[a] || 0) + 1), h[c].push(l)) : (f[e] = f[e] || [], f[e].push(l));
            return this
        },
        hasEventListeners: function(n) {
            var t = this[u];
            return !!t && (n in t && t[n].length > 0 || n + "_idx" in t && t[n + "_idx_len"] > 0)
        },
        removeEventListener: function(n, t, i) {
            if (!this[u]) return this;
            if (!n) return this.clearAllEventListeners();
            if (r.Util.invokeEach(n, this.removeEventListener, this, t, i)) return this;
            var h, y, c, f, e, l, a, s, p, o = this[u],
                v = i && i !== this && r.stamp(i);
            for (n = r.Util.splitWords(n), h = 0, y = n.length; y > h; h++)
                if (c = n[h], l = c + "_idx", a = l + "_len", s = o[l], t) {
                    if (f = v && s ? s[v] : o[c]) {
                        for (e = f.length - 1; e >= 0; e--) f[e].action !== t || i && f[e].context !== i || (p = f.splice(e, 1), p[0].action = r.Util.falseFn);
                        i && s && 0 === f.length && (delete s[v], o[a]--)
                    }
                } else delete o[c], delete o[l], delete o[a];
            return this
        },
        clearAllEventListeners: function() {
            return delete this[u], this
        },
        fireEvent: function(n, t) {
            if (!this.hasEventListeners(n)) return this;
            var f, i, e, o, h, c = r.Util.extend({}, t, {
                    type: n,
                    target: this
                }),
                s = this[u];
            if (s[n])
                for (f = s[n].slice(), i = 0, e = f.length; e > i; i++) f[i].action.call(f[i].context, c);
            o = s[n + "_idx"];
            for (h in o)
                if (f = o[h].slice())
                    for (i = 0, e = f.length; e > i; i++) f[i].action.call(f[i].context, c);
            return this
        },
        addOneTimeEventListener: function(n, t, i) {
            if (r.Util.invokeEach(n, this.addOneTimeEventListener, this, t, i)) return this;
            var u = r.bind(function() {
                this.removeEventListener(n, t, i).removeEventListener(n, u, i)
            }, this);
            return this.addEventListener(n, t, i).addEventListener(n, u, i)
        }
    };
    r.Mixin.Events.on = r.Mixin.Events.addEventListener;
    r.Mixin.Events.off = r.Mixin.Events.removeEventListener;
    r.Mixin.Events.once = r.Mixin.Events.addOneTimeEventListener;
    r.Mixin.Events.fire = r.Mixin.Events.fireEvent,
        function() {
            var f = "ActiveXObject" in n,
                b = f && !t.addEventListener,
                u = navigator.userAgent.toLowerCase(),
                s = -1 !== u.indexOf("webkit"),
                k = -1 !== u.indexOf("chrome"),
                c = -1 !== u.indexOf("phantom"),
                d = -1 !== u.indexOf("android"),
                l = -1 !== u.search("android [23]"),
                g = -1 !== u.indexOf("gecko"),
                e = typeof orientation != i + "",
                a = n.navigator && n.navigator.msPointerEnabled && n.navigator.msMaxTouchPoints && !n.PointerEvent,
                v = n.PointerEvent && n.navigator.pointerEnabled && n.navigator.maxTouchPoints || a,
                nt = "devicePixelRatio" in n && n.devicePixelRatio > 1 || "matchMedia" in n && n.matchMedia("(min-resolution:144dpi)") && n.matchMedia("(min-resolution:144dpi)").matches,
                o = t.documentElement,
                y = f && "transition" in o.style,
                h = "WebKitCSSMatrix" in n && "m11" in new n.WebKitCSSMatrix && !l,
                p = "MozPerspective" in o.style,
                w = "OTransition" in o.style,
                tt = !n.L_DISABLE_3D && (y || h || p || w) && !c,
                it = !n.L_NO_TOUCH && !c && function() {
                    var i = "ontouchstart",
                        n, r;
                    return v || i in o ? !0 : (n = t.createElement("div"), r = !1, n.setAttribute ? (n.setAttribute(i, "return;"), "function" == typeof n[i] && (r = !0), n.removeAttribute(i), n = null, r) : !1)
                }();
            r.Browser = {
                ie: f,
                ielt9: b,
                webkit: s,
                gecko: g && !s && !n.opera && !f,
                android: d,
                android23: l,
                chrome: k,
                ie3d: y,
                webkit3d: h,
                gecko3d: p,
                opera3d: w,
                any3d: tt,
                mobile: e,
                mobileWebkit: e && s,
                mobileWebkit3d: e && h,
                mobileOpera: e && n.opera,
                touch: it,
                msPointer: a,
                pointer: v,
                retina: nt
            }
        }();
    r.Point = function(n, t, i) {
        this.x = i ? Math.round(n) : n;
        this.y = i ? Math.round(t) : t
    };
    r.Point.prototype = {
        clone: function() {
            return new r.Point(this.x, this.y)
        },
        add: function(n) {
            return this.clone()._add(r.point(n))
        },
        _add: function(n) {
            return this.x += n.x, this.y += n.y, this
        },
        subtract: function(n) {
            return this.clone()._subtract(r.point(n))
        },
        _subtract: function(n) {
            return this.x -= n.x, this.y -= n.y, this
        },
        divideBy: function(n) {
            return this.clone()._divideBy(n)
        },
        _divideBy: function(n) {
            return this.x /= n, this.y /= n, this
        },
        multiplyBy: function(n) {
            return this.clone()._multiplyBy(n)
        },
        _multiplyBy: function(n) {
            return this.x *= n, this.y *= n, this
        },
        round: function() {
            return this.clone()._round()
        },
        _round: function() {
            return this.x = Math.round(this.x), this.y = Math.round(this.y), this
        },
        floor: function() {
            return this.clone()._floor()
        },
        _floor: function() {
            return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
        },
        distanceTo: function(n) {
            n = r.point(n);
            var t = n.x - this.x,
                i = n.y - this.y;
            return Math.sqrt(t * t + i * i)
        },
        equals: function(n) {
            return n = r.point(n), n.x === this.x && n.y === this.y
        },
        contains: function(n) {
            return n = r.point(n), Math.abs(n.x) <= Math.abs(this.x) && Math.abs(n.y) <= Math.abs(this.y)
        },
        toString: function() {
            return "Point(" + r.Util.formatNum(this.x) + ", " + r.Util.formatNum(this.y) + ")"
        }
    };
    r.point = function(n, t, u) {
        return n instanceof r.Point ? n : r.Util.isArray(n) ? new r.Point(n[0], n[1]) : n === i || null === n ? n : new r.Point(n, t, u)
    };
    r.Bounds = function(n, t) {
        if (n)
            for (var r = t ? [n, t] : n, i = 0, u = r.length; u > i; i++) this.extend(r[i])
    };
    r.Bounds.prototype = {
        extend: function(n) {
            return n = r.point(n), this.min || this.max ? (this.min.x = Math.min(n.x, this.min.x), this.max.x = Math.max(n.x, this.max.x), this.min.y = Math.min(n.y, this.min.y), this.max.y = Math.max(n.y, this.max.y)) : (this.min = n.clone(), this.max = n.clone()), this
        },
        getCenter: function(n) {
            return new r.Point((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, n)
        },
        getBottomLeft: function() {
            return new r.Point(this.min.x, this.max.y)
        },
        getTopRight: function() {
            return new r.Point(this.max.x, this.min.y)
        },
        getSize: function() {
            return this.max.subtract(this.min)
        },
        contains: function(n) {
            var t, i;
            return n = "number" == typeof n[0] || n instanceof r.Point ? r.point(n) : r.bounds(n), n instanceof r.Bounds ? (t = n.min, i = n.max) : t = i = n, t.x >= this.min.x && i.x <= this.max.x && t.y >= this.min.y && i.y <= this.max.y
        },
        intersects: function(n) {
            n = r.bounds(n);
            var t = this.min,
                i = this.max,
                u = n.min,
                f = n.max,
                e = f.x >= t.x && u.x <= i.x,
                o = f.y >= t.y && u.y <= i.y;
            return e && o
        },
        isValid: function() {
            return !(!this.min || !this.max)
        }
    };
    r.bounds = function(n, t) {
        return !n || n instanceof r.Bounds ? n : new r.Bounds(n, t)
    };
    r.Transformation = function(n, t, i, r) {
        this._a = n;
        this._b = t;
        this._c = i;
        this._d = r
    };
    r.Transformation.prototype = {
        transform: function(n, t) {
            return this._transform(n.clone(), t)
        },
        _transform: function(n, t) {
            return t = t || 1, n.x = t * (this._a * n.x + this._b), n.y = t * (this._c * n.y + this._d), n
        },
        untransform: function(n, t) {
            return t = t || 1, new r.Point((n.x / t - this._b) / this._a, (n.y / t - this._d) / this._c)
        }
    };
    r.DomUtil = {
        get: function(n) {
            return "string" == typeof n ? t.getElementById(n) : n
        },
        getStyle: function(n, i) {
            var r = n.style[i],
                u;
            return (!r && n.currentStyle && (r = n.currentStyle[i]), (!r || "auto" === r) && t.defaultView) && (u = t.defaultView.getComputedStyle(n, null), r = u ? u[i] : null), "auto" === r ? null : r
        },
        getViewportOffset: function(n) {
            var o, u = 0,
                f = 0,
                i = n,
                e = t.body,
                s = t.documentElement;
            do {
                if (u += i.offsetTop || 0, f += i.offsetLeft || 0, u += parseInt(r.DomUtil.getStyle(i, "borderTopWidth"), 10) || 0, f += parseInt(r.DomUtil.getStyle(i, "borderLeftWidth"), 10) || 0, o = r.DomUtil.getStyle(i, "position"), i.offsetParent === e && "absolute" === o) break;
                if ("fixed" === o) {
                    u += e.scrollTop || s.scrollTop || 0;
                    f += e.scrollLeft || s.scrollLeft || 0;
                    break
                }
                if ("relative" === o && !i.offsetLeft) {
                    var c = r.DomUtil.getStyle(i, "width"),
                        l = r.DomUtil.getStyle(i, "max-width"),
                        h = i.getBoundingClientRect();
                    ("none" !== c || "none" !== l) && (f += h.left + i.clientLeft);
                    u += h.top + (e.scrollTop || s.scrollTop || 0);
                    break
                }
                i = i.offsetParent
            } while (i);
            i = n;
            do {
                if (i === e) break;
                u -= i.scrollTop || 0;
                f -= i.scrollLeft || 0;
                i = i.parentNode
            } while (i);
            return new r.Point(f, u)
        },
        documentIsLtr: function() {
            return r.DomUtil._docIsLtrCached || (r.DomUtil._docIsLtrCached = !0, r.DomUtil._docIsLtr = "ltr" === r.DomUtil.getStyle(t.body, "direction")), r.DomUtil._docIsLtr
        },
        create: function(n, i, r) {
            var u = t.createElement(n);
            return u.className = i, r && r.appendChild(u), u
        },
        hasClass: function(n, t) {
            if (n.classList !== i) return n.classList.contains(t);
            var u = r.DomUtil._getClass(n);
            return u.length > 0 && new RegExp("(^|\\s)" + t + "(\\s|$)").test(u)
        },
        addClass: function(n, t) {
            var f;
            if (n.classList !== i)
                for (var e = r.Util.splitWords(t), u = 0, o = e.length; o > u; u++) n.classList.add(e[u]);
            else r.DomUtil.hasClass(n, t) || (f = r.DomUtil._getClass(n), r.DomUtil._setClass(n, (f ? f + " " : "") + t))
        },
        removeClass: function(n, t) {
            n.classList !== i ? n.classList.remove(t) : r.DomUtil._setClass(n, r.Util.trim((" " + r.DomUtil._getClass(n) + " ").replace(" " + t + " ", " ")))
        },
        _setClass: function(n, t) {
            n.className.baseVal === i ? n.className = t : n.className.baseVal = t
        },
        _getClass: function(n) {
            return n.className.baseVal === i ? n.className : n.className.baseVal
        },
        setOpacity: function(n, t) {
            if ("opacity" in n.style) n.style.opacity = t;
            else if ("filter" in n.style) {
                var i = !1,
                    r = "DXImageTransform.Microsoft.Alpha";
                try {
                    i = n.filters.item(r)
                } catch (u) {
                    if (1 === t) return
                }
                t = Math.round(100 * t);
                i ? (i.Enabled = 100 !== t, i.Opacity = t) : n.style.filter += " progid:" + r + "(opacity=" + t + ")"
            }
        },
        testProp: function(n) {
            for (var r = t.documentElement.style, i = 0; i < n.length; i++)
                if (n[i] in r) return n[i];
            return !1
        },
        getTranslateString: function(n) {
            var t = r.Browser.webkit3d,
                i = "translate" + (t ? "3d" : "") + "(",
                u = (t ? ",0" : "") + ")";
            return i + n.x + "px," + n.y + "px" + u
        },
        getScaleString: function(n, t) {
            var i = r.DomUtil.getTranslateString(t.add(t.multiplyBy(-1 * n))),
                u = " scale(" + n + ") ";
            return i + u
        },
        setPosition: function(n, t, i) {
            n._tmap_pos = t;
            !i && r.Browser.any3d ? n.style[r.DomUtil.TRANSFORM] = r.DomUtil.getTranslateString(t) : (n.style.left = t.x + "px", n.style.top = t.y + "px")
        },
        getPosition: function(n) {
            return n._tmap_pos
        }
    };
    r.DomUtil.TRANSFORM = r.DomUtil.testProp(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]);
    r.DomUtil.TRANSITION = r.DomUtil.testProp(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
    r.DomUtil.TRANSITION_END = "webkitTransition" === r.DomUtil.TRANSITION || "OTransition" === r.DomUtil.TRANSITION ? r.DomUtil.TRANSITION + "End" : "transitionend",
        function() {
            if ("onselectstart" in t) r.extend(r.DomUtil, {
                disableTextSelection: function() {
                    r.DomEvent.on(n, "selectstart", r.DomEvent.preventDefault)
                },
                enableTextSelection: function() {
                    r.DomEvent.off(n, "selectstart", r.DomEvent.preventDefault)
                }
            });
            else {
                var i = r.DomUtil.testProp(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
                r.extend(r.DomUtil, {
                    disableTextSelection: function() {
                        if (i) {
                            var n = t.documentElement.style;
                            this._userSelect = n[i];
                            n[i] = "none"
                        }
                    },
                    enableTextSelection: function() {
                        i && (t.documentElement.style[i] = this._userSelect, delete this._userSelect)
                    }
                })
            }
            r.extend(r.DomUtil, {
                disableImageDrag: function() {
                    r.DomEvent.on(n, "dragstart", r.DomEvent.preventDefault)
                },
                enableImageDrag: function() {
                    r.DomEvent.off(n, "dragstart", r.DomEvent.preventDefault)
                }
            })
        }();
    r.LatLng = function(n, t, r) {
        if (n = parseFloat(n), t = parseFloat(t), isNaN(n) || isNaN(t)) throw new Error("Invalid LatLng object: (" + n + ", " + t + ")");
        this.lat = n;
        this.lng = t;
        r !== i && (this.alt = parseFloat(r))
    };
    r.extend(r.LatLng, {
        DEG_TO_RAD: Math.PI / 180,
        RAD_TO_DEG: 180 / Math.PI,
        MAX_MARGIN: 1e-9
    });
    r.LatLng.prototype = {
        equals: function(n) {
            if (!n) return !1;
            n = r.latLng(n);
            var t = Math.max(Math.abs(this.lat - n.lat), Math.abs(this.lng - n.lng));
            return t <= r.LatLng.MAX_MARGIN
        },
        toString: function(n) {
            return "LatLng(" + r.Util.formatNum(this.lat, n) + ", " + r.Util.formatNum(this.lng, n) + ")"
        },
        distanceTo: function(n) {
            n = r.latLng(n);
            var t = r.LatLng.DEG_TO_RAD,
                e = (n.lat - this.lat) * t,
                o = (n.lng - this.lng) * t,
                s = this.lat * t,
                h = n.lat * t,
                i = Math.sin(e / 2),
                u = Math.sin(o / 2),
                f = i * i + u * u * Math.cos(s) * Math.cos(h);
            return 12756274 * Math.atan2(Math.sqrt(f), Math.sqrt(1 - f))
        },
        wrap: function(n, t) {
            var i = this.lng;
            return n = n || -180, t = t || 180, i = (i + t) % (t - n) + (n > i || i === t ? t : n), new r.LatLng(this.lat, i)
        }
    };
    r.latLng = function(n, t) {
        return n instanceof r.LatLng ? n : r.Util.isArray(n) ? "number" == typeof n[0] || "string" == typeof n[0] ? new r.LatLng(n[0], n[1], n[2]) : null : n === i || null === n ? n : "object" == typeof n && "lat" in n ? new r.LatLng(n.lat, "lng" in n ? n.lng : n.lon) : t === i ? null : new r.LatLng(n, t)
    };
    r.LatLngBounds = function(n, t) {
        if (n)
            for (var r = t ? [n, t] : n, i = 0, u = r.length; u > i; i++) this.extend(r[i])
    };
    r.LatLngBounds.prototype = {
        extend: function(n) {
            if (!n) return this;
            var t = r.latLng(n);
            return n = null !== t ? t : r.latLngBounds(n), n instanceof r.LatLng ? this._southWest || this._northEast ? (this._southWest.lat = Math.min(n.lat, this._southWest.lat), this._southWest.lng = Math.min(n.lng, this._southWest.lng), this._northEast.lat = Math.max(n.lat, this._northEast.lat), this._northEast.lng = Math.max(n.lng, this._northEast.lng)) : (this._southWest = new r.LatLng(n.lat, n.lng), this._northEast = new r.LatLng(n.lat, n.lng)) : n instanceof r.LatLngBounds && (this.extend(n._southWest), this.extend(n._northEast)), this
        },
        pad: function(n) {
            var t = this._southWest,
                i = this._northEast,
                u = Math.abs(t.lat - i.lat) * n,
                f = Math.abs(t.lng - i.lng) * n;
            return new r.LatLngBounds(new r.LatLng(t.lat - u, t.lng - f), new r.LatLng(i.lat + u, i.lng + f))
        },
        getCenter: function() {
            return new r.LatLng((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
        },
        getSouthWest: function() {
            return this._southWest
        },
        getNorthEast: function() {
            return this._northEast
        },
        getNorthWest: function() {
            return new r.LatLng(this.getNorth(), this.getWest())
        },
        getSouthEast: function() {
            return new r.LatLng(this.getSouth(), this.getEast())
        },
        getWest: function() {
            return this._southWest.lng
        },
        getSouth: function() {
            return this._southWest.lat
        },
        getEast: function() {
            return this._northEast.lng
        },
        getNorth: function() {
            return this._northEast.lat
        },
        contains: function(n) {
            n = "number" == typeof n[0] || n instanceof r.LatLng ? r.latLng(n) : r.latLngBounds(n);
            var t, i, u = this._southWest,
                f = this._northEast;
            return n instanceof r.LatLngBounds ? (t = n.getSouthWest(), i = n.getNorthEast()) : t = i = n, t.lat >= u.lat && i.lat <= f.lat && t.lng >= u.lng && i.lng <= f.lng
        },
        intersects: function(n) {
            n = r.latLngBounds(n);
            var t = this._southWest,
                i = this._northEast,
                u = n.getSouthWest(),
                f = n.getNorthEast(),
                e = f.lat >= t.lat && u.lat <= i.lat,
                o = f.lng >= t.lng && u.lng <= i.lng;
            return e && o
        },
        toBBoxString: function() {
            return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
        },
        equals: function(n) {
            return n ? (n = r.latLngBounds(n), this._southWest.equals(n.getSouthWest()) && this._northEast.equals(n.getNorthEast())) : !1
        },
        isValid: function() {
            return !(!this._southWest || !this._northEast)
        }
    };
    r.latLngBounds = function(n, t) {
        return !n || n instanceof r.LatLngBounds ? n : new r.LatLngBounds(n, t)
    };
    r.Projection = {};
    r.Projection.SphericalMercator = {
        MAX_LATITUDE: 85.0511287798,
        project: function(n) {
            var i = r.LatLng.DEG_TO_RAD,
                u = this.MAX_LATITUDE,
                f = Math.max(Math.min(u, n.lat), -u),
                e = n.lng * i,
                t = f * i;
            return t = Math.log(Math.tan(Math.PI / 4 + t / 2)), new r.Point(e, t)
        },
        unproject: function(n) {
            var t = r.LatLng.RAD_TO_DEG,
                i = n.x * t,
                u = (2 * Math.atan(Math.exp(n.y)) - Math.PI / 2) * t;
            return new r.LatLng(u, i)
        }
    };
    r.Projection.LonLat = {
        project: function(n) {
            return new r.Point(n.lng, n.lat)
        },
        unproject: function(n) {
            return new r.LatLng(n.y, n.x)
        }
    };
    r.CRS = {
        latLngToPoint: function(n, t) {
            var i = this.projection.project(n),
                r = this.scale(t);
            return this.transformation._transform(i, r)
        },
        pointToLatLng: function(n, t) {
            var i = this.scale(t),
                r = this.transformation.untransform(n, i);
            return this.projection.unproject(r)
        },
        project: function(n) {
            return this.projection.project(n)
        },
        scale: function(n) {
            return 256 * Math.pow(2, n)
        },
        getSize: function(n) {
            var t = this.scale(n);
            return r.point(t, t)
        }
    };
    r.CRS.Simple = r.extend({}, r.CRS, {
        projection: r.Projection.LonLat,
        transformation: new r.Transformation(1, 0, -1, 0),
        scale: function(n) {
            return Math.pow(2, n)
        }
    });
    r.CRS.EPSG3857 = r.extend({}, r.CRS, {
        code: "EPSG:3857",
        projection: r.Projection.SphericalMercator,
        transformation: new r.Transformation(.5 / Math.PI, .5, -.5 / Math.PI, .5),
        project: function(n) {
            var t = this.projection.project(n);
            return t.multiplyBy(6378137)
        }
    });
    r.CRS.EPSG900913 = r.extend({}, r.CRS.EPSG3857, {
        code: "EPSG:900913"
    });
    r.CRS.EPSG4326 = r.extend({}, r.CRS, {
        code: "EPSG:4326",
        projection: r.Projection.LonLat,
        transformation: new r.Transformation(1 / 360, .5, -1 / 360, .5)
    });
    r.Map = r.Class.extend({
        includes: r.Mixin.Events,
        options: {
            crs: r.CRS.EPSG3857,
            fadeAnimation: r.DomUtil.TRANSITION && !r.Browser.android23,
            trackResize: !0,
            markerZoomAnimation: r.DomUtil.TRANSITION && r.Browser.any3d
        },
        initialize: function(n, t) {
            t = r.setOptions(this, t);
            this._initContainer(n);
            this._initLayout();
            this._onResize = r.bind(this._onResize, this);
            this._initEvents();
            t.maxBounds && this.setMaxBounds(t.maxBounds);
            t.center && t.zoom !== i && this.setView(r.latLng(t.center), t.zoom, {
                reset: !0
            });
            this._handlers = [];
            this._layers = {};
            this._zoomBoundLayers = {};
            this._tileLayersNum = 0;
            this.callInitHooks();
            this._addLayers(t.layers)
        },
        setView: function(n, t) {
            return t = t === i ? this.getZoom() : t, this._resetView(r.latLng(n), this._limitZoom(t)), this
        },
        setZoom: function(n, t) {
            return this._loaded ? this.setView(this.getCenter(), n, {
                zoom: t
            }) : (this._zoom = this._limitZoom(n), this)
        },
        zoomIn: function(n, t) {
            return this.setZoom(this._zoom + (n || 1), t)
        },
        zoomOut: function(n, t) {
            return this.setZoom(this._zoom - (n || 1), t)
        },
        setZoomAround: function(n, t, i) {
            var f = this.getZoomScale(t),
                u = this.getSize().divideBy(2),
                e = n instanceof r.Point ? n : this.latLngToContainerPoint(n),
                o = e.subtract(u).multiplyBy(1 - 1 / f),
                s = this.containerPointToLatLng(u.add(o));
            return this.setView(s, t, {
                zoom: i
            })
        },
        fitBounds: function(n, t) {
            t = t || {};
            n = n.getBounds ? n.getBounds() : r.latLngBounds(n);
            var u = r.point(t.paddingTopLeft || t.padding || [0, 0]),
                f = r.point(t.paddingBottomRight || t.padding || [0, 0]),
                i = this.getBoundsZoom(n, !1, u.add(f)),
                e = f.subtract(u).divideBy(2),
                o = this.project(n.getSouthWest(), i),
                s = this.project(n.getNorthEast(), i),
                h = this.unproject(o.add(s).divideBy(2).add(e), i);
            return i = t && t.maxZoom ? Math.min(t.maxZoom, i) : i, this.setView(h, i, t)
        },
        fitWorld: function(n) {
            return this.fitBounds([
                [-90, -180],
                [90, 180]
            ], n)
        },
        panTo: function(n, t) {
            return this.setView(n, this._zoom, {
                pan: t
            })
        },
        panBy: function(n) {
            return this.fire("movestart"), this._rawPanBy(r.point(n)), this.fire("move"), this.fire("moveend")
        },
        setMaxBounds: function(n) {
            return n = r.latLngBounds(n), this.options.maxBounds = n, n ? (this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds, this)) : this.off("moveend", this._panInsideMaxBounds, this)
        },
        panInsideBounds: function(n, t) {
            var i = this.getCenter(),
                r = this._limitCenter(i, this._zoom, n);
            return i.equals(r) ? this : this.panTo(r, t)
        },
        addLayer: function(n) {
            var t = r.stamp(n);
            return this._layers[t] ? this : (this._layers[t] = n, !n.options || isNaN(n.options.maxZoom) && isNaN(n.options.minZoom) || (this._zoomBoundLayers[t] = n, this._updateZoomLevels()), this.options.zoomAnimation && r.TileLayer && n instanceof r.TileLayer && (this._tileLayersNum++, this._tileLayersToLoad++, n.on("load", this._onTileLayerLoad, this)), this._loaded && this._layerAdd(n), this)
        },
        removeLayer: function(n) {
            var t = r.stamp(n);
            return this._layers[t] ? (this._loaded && n.onRemove(this), delete this._layers[t], this._loaded && this.fire("layerremove", {
                layer: n
            }), this._zoomBoundLayers[t] && (delete this._zoomBoundLayers[t], this._updateZoomLevels()), this.options.zoomAnimation && r.TileLayer && n instanceof r.TileLayer && (this._tileLayersNum--, this._tileLayersToLoad--, n.off("load", this._onTileLayerLoad, this)), this) : this
        },
        hasLayer: function(n) {
            return n ? r.stamp(n) in this._layers : !1
        },
        eachLayer: function(n, t) {
            for (var i in this._layers) n.call(t, this._layers[i]);
            return this
        },
        invalidateSize: function(n) {
            var i;
            if (!this._loaded) return this;
            n = r.extend({
                animate: !1,
                pan: !0
            }, n === !0 ? {
                animate: !0
            } : n);
            i = this.getSize();
            this._sizeChanged = !0;
            this._initialCenter = null;
            var u = this.getSize(),
                f = i.divideBy(2).round(),
                e = u.divideBy(2).round(),
                t = f.subtract(e);
            return t.x || t.y ? (n.animate && n.pan ? this.panBy(t) : (n.pan && this._rawPanBy(t), this.fire("move"), n.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(r.bind(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
                oldSize: i,
                newSize: u
            })) : this
        },
        addHandler: function(n, t) {
            if (!t) return this;
            var i = this[n] = new t(this);
            return this._handlers.push(i), this.options[n] && i.enable(), this
        },
        remove: function() {
            this._loaded && this.fire("unload");
            this._initEvents("off");
            try {
                delete this._container._tmap
            } catch (n) {
                this._container._tmap = i
            }
            return this._clearPanes(), this._clearControlPos && this._clearControlPos(), this._clearHandlers(), this
        },
        getCenter: function() {
            return this._checkIfLoaded(), this._initialCenter && !this._moved() ? this._initialCenter : this.layerPointToLatLng(this._getCenterLayerPoint())
        },
        getZoom: function() {
            return this._zoom
        },
        getBounds: function() {
            var n = this.getPixelBounds(),
                t = this.unproject(n.getBottomLeft()),
                i = this.unproject(n.getTopRight());
            return new r.LatLngBounds(t, i)
        },
        getMinZoom: function() {
            return this.options.minZoom === i ? this._layersMinZoom === i ? 0 : this._layersMinZoom : this.options.minZoom
        },
        getMaxZoom: function() {
            return this.options.maxZoom === i ? this._layersMaxZoom === i ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom
        },
        getBoundsZoom: function(n, t, i) {
            n = r.latLngBounds(n);
            var f, u = this.getMinZoom() - (t ? 1 : 0),
                s = this.getMaxZoom(),
                e = this.getSize(),
                h = n.getNorthWest(),
                c = n.getSouthEast(),
                o = !0;
            i = r.point(i || [0, 0]);
            do u++, f = this.project(c, u).subtract(this.project(h, u)).add(i), o = t ? f.x < e.x || f.y < e.y : e.contains(f); while (o && s >= u);
            return o && t ? null : t ? u : u - 1
        },
        getSize: function() {
            return (!this._size || this._sizeChanged) && (this._size = new r.Point(this._container.clientWidth, this._container.clientHeight), this._sizeChanged = !1), this._size.clone()
        },
        getPixelBounds: function() {
            var n = this._getTopLeftPoint();
            return new r.Bounds(n, n.add(this.getSize()))
        },
        getPixelOrigin: function() {
            return this._checkIfLoaded(), this._initialTopLeftPoint
        },
        getPanes: function() {
            return this._panes
        },
        getContainer: function() {
            return this._container
        },
        getZoomScale: function(n) {
            var t = this.options.crs;
            return t.scale(n) / t.scale(this._zoom)
        },
        getScaleZoom: function(n) {
            return this._zoom + Math.log(n) / Math.LN2
        },
        project: function(n, t) {
            return t = t === i ? this._zoom : t, this.options.crs.latLngToPoint(r.latLng(n), t)
        },
        unproject: function(n, t) {
            return t = t === i ? this._zoom : t, this.options.crs.pointToLatLng(r.point(n), t)
        },
        layerPointToLatLng: function(n) {
            var t = r.point(n).add(this.getPixelOrigin());
            return this.unproject(t)
        },
        latLngToLayerPoint: function(n) {
            var t = this.project(r.latLng(n))._round();
            return t._subtract(this.getPixelOrigin())
        },
        containerPointToLayerPoint: function(n) {
            return r.point(n).subtract(this._getMapPanePos())
        },
        layerPointToContainerPoint: function(n) {
            return r.point(n).add(this._getMapPanePos())
        },
        containerPointToLatLng: function(n) {
            var t = this.containerPointToLayerPoint(r.point(n));
            return this.layerPointToLatLng(t)
        },
        latLngToContainerPoint: function(n) {
            return this.layerPointToContainerPoint(this.latLngToLayerPoint(r.latLng(n)))
        },
        mouseEventToContainerPoint: function(n) {
            return r.DomEvent.getMousePosition(n, this._container)
        },
        mouseEventToLayerPoint: function(n) {
            return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(n))
        },
        mouseEventToLatLng: function(n) {
            return this.layerPointToLatLng(this.mouseEventToLayerPoint(n))
        },
        _initContainer: function(n) {
            var t = this._container = r.DomUtil.get(n);
            if (!t) throw new Error("Map container not found.");
            if (t._tmap) throw new Error("Map container is already initialized.");
            t._tmap = !0
        },
        _initLayout: function() {
            var t = this._container,
                n;
            r.DomUtil.addClass(t, "tmap-container" + (r.Browser.touch ? " tmap-touch" : "") + (r.Browser.retina ? " tmap-retina" : "") + (r.Browser.ielt9 ? " tmap-oldie" : "") + (this.options.fadeAnimation ? " tmap-fade-anim" : ""));
            n = r.DomUtil.getStyle(t, "position");
            "absolute" !== n && "relative" !== n && "fixed" !== n && (t.style.position = "relative");
            this._initPanes();
            this._initControlPos && this._initControlPos()
        },
        _initPanes: function() {
            var n = this._panes = {},
                t;
            this._mapPane = n.mapPane = this._createPane("tmap-map-pane", this._container);
            this._tilePane = n.tilePane = this._createPane("tmap-tile-pane", this._mapPane);
            n.objectsPane = this._createPane("tmap-objects-pane", this._mapPane);
            n.shadowPane = this._createPane("tmap-shadow-pane");
            n.overlayPane = this._createPane("tmap-overlay-pane");
            n.markerPane = this._createPane("tmap-marker-pane");
            n.popupPane = this._createPane("tmap-popup-pane");
            t = " tmap-zoom-hide";
            this.options.markerZoomAnimation || (r.DomUtil.addClass(n.markerPane, t), r.DomUtil.addClass(n.shadowPane, t), r.DomUtil.addClass(n.popupPane, t))
        },
        _createPane: function(n, t) {
            return r.DomUtil.create("div", n, t || this._panes.objectsPane)
        },
        _clearPanes: function() {
            this._container.removeChild(this._mapPane)
        },
        _addLayers: function(n) {
            n = n ? r.Util.isArray(n) ? n : [n] : [];
            for (var t = 0, i = n.length; i > t; t++) this.addLayer(n[t])
        },
        _resetView: function(n, t, i, u) {
            var f = this._zoom !== t,
                e;
            u || (this.fire("movestart"), f && this.fire("zoomstart"));
            this._zoom = t;
            this._initialCenter = n;
            this._initialTopLeftPoint = this._getNewTopLeftPoint(n);
            i ? this._initialTopLeftPoint._add(this._getMapPanePos()) : r.DomUtil.setPosition(this._mapPane, new r.Point(0, 0));
            this._tileLayersToLoad = this._tileLayersNum;
            e = !this._loaded;
            this._loaded = !0;
            e && (this.fire("load"), this.eachLayer(this._layerAdd, this));
            this.fire("viewreset", {
                hard: !i
            });
            this.fire("move");
            (f || u) && this.fire("zoomend");
            this.fire("moveend", {
                hard: !i
            })
        },
        _rawPanBy: function(n) {
            r.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(n))
        },
        _getZoomSpan: function() {
            return this.getMaxZoom() - this.getMinZoom()
        },
        _updateZoomLevels: function() {
            var t, r = 1 / 0,
                u = -1 / 0,
                f = this._getZoomSpan(),
                n;
            for (t in this._zoomBoundLayers) n = this._zoomBoundLayers[t], isNaN(n.options.minZoom) || (r = Math.min(r, n.options.minZoom)), isNaN(n.options.maxZoom) || (u = Math.max(u, n.options.maxZoom));
            t === i ? this._layersMaxZoom = this._layersMinZoom = i : (this._layersMaxZoom = u, this._layersMinZoom = r);
            f !== this._getZoomSpan() && this.fire("zoomlevelschange")
        },
        _panInsideMaxBounds: function() {
            this.panInsideBounds(this.options.maxBounds)
        },
        _checkIfLoaded: function() {
            if (!this._loaded) throw new Error("Set map center and zoom first.");
        },
        _initEvents: function(t) {
            if (r.DomEvent) {
                t = t || "on";
                r.DomEvent[t](this._container, "click", this._onMouseClick, this);
                for (var f = ["dblclick", "mousedown", "mouseup", "mouseenter", "mouseleave", "mousemove", "contextmenu"], i = 0, u = f.length; u > i; i++) r.DomEvent[t](this._container, f[i], this._fireMouseEvent, this);
                this.options.trackResize && r.DomEvent[t](n, "resize", this._onResize, this)
            }
        },
        _onResize: function() {
            r.Util.cancelAnimFrame(this._resizeRequest);
            this._resizeRequest = r.Util.requestAnimFrame(function() {
                this.invalidateSize({
                    debounceMoveend: !0
                })
            }, this, !1, this._container)
        },
        _onMouseClick: function(n) {
            !this._loaded || !n._simulated && (this.dragging && this.dragging.moved() || this.boxZoom && this.boxZoom.moved()) || r.DomEvent._skipped(n) || (this.fire("preclick"), this._fireMouseEvent(n))
        },
        _fireMouseEvent: function(n) {
            var t;
            if (this._loaded && !r.DomEvent._skipped(n) && (t = n.type, t = "mouseenter" === t ? "mouseover" : "mouseleave" === t ? "mouseout" : t, this.hasEventListeners(t))) {
                "contextmenu" === t && r.DomEvent.preventDefault(n);
                var i = this.mouseEventToContainerPoint(n),
                    u = this.containerPointToLayerPoint(i),
                    f = this.layerPointToLatLng(u);
                this.fire(t, {
                    latlng: f,
                    layerPoint: u,
                    containerPoint: i,
                    originalEvent: n
                })
            }
        },
        _onTileLayerLoad: function() {
            this._tileLayersToLoad--;
            this._tileLayersNum && !this._tileLayersToLoad && this.fire("tilelayersload")
        },
        _clearHandlers: function() {
            for (var n = 0, t = this._handlers.length; t > n; n++) this._handlers[n].disable()
        },
        whenReady: function(n, t) {
            return this._loaded ? n.call(t || this, this) : this.on("load", n, t), this
        },
        _layerAdd: function(n) {
            n.onAdd(this);
            this.fire("layeradd", {
                layer: n
            })
        },
        _getMapPanePos: function() {
            return r.DomUtil.getPosition(this._mapPane)
        },
        _moved: function() {
            var n = this._getMapPanePos();
            return n && !n.equals([0, 0])
        },
        _getTopLeftPoint: function() {
            return this.getPixelOrigin().subtract(this._getMapPanePos())
        },
        _getNewTopLeftPoint: function(n, t) {
            var i = this.getSize()._divideBy(2);
            return this.project(n, t)._subtract(i)._round()
        },
        _latLngToNewLayerPoint: function(n, t, i) {
            var r = this._getNewTopLeftPoint(i, t).add(this._getMapPanePos());
            return this.project(n, t)._subtract(r)
        },
        _getCenterLayerPoint: function() {
            return this.containerPointToLayerPoint(this.getSize()._divideBy(2))
        },
        _getCenterOffset: function(n) {
            return this.latLngToLayerPoint(n).subtract(this._getCenterLayerPoint())
        },
        _limitCenter: function(n, t, i) {
            if (!i) return n;
            var u = this.project(n, t),
                f = this.getSize().divideBy(2),
                e = new r.Bounds(u.subtract(f), u.add(f)),
                o = this._getBoundsOffset(e, i, t);
            return this.unproject(u.add(o), t)
        },
        _limitOffset: function(n, t) {
            if (!t) return n;
            var i = this.getPixelBounds(),
                u = new r.Bounds(i.min.add(n), i.max.add(n));
            return n.add(this._getBoundsOffset(u, t))
        },
        _getBoundsOffset: function(n, t, i) {
            var u = this.project(t.getNorthWest(), i).subtract(n.min),
                f = this.project(t.getSouthEast(), i).subtract(n.max),
                e = this._rebound(u.x, -f.x),
                o = this._rebound(u.y, -f.y);
            return new r.Point(e, o)
        },
        _rebound: function(n, t) {
            return n + t > 0 ? Math.round(n - t) / 2 : Math.max(0, Math.ceil(n)) - Math.max(0, Math.floor(t))
        },
        _limitZoom: function(n) {
            var t = this.getMinZoom(),
                i = this.getMaxZoom();
            return Math.max(t, Math.min(i, n))
        }
    });
    r.map = function(n, t) {
        return new r.Map(n, t)
    };
    r.Projection.Mercator = {
        MAX_LATITUDE: 85.0840591556,
        R_MINOR: 6356752.3142451793,
        R_MAJOR: 6378137,
        project: function(n) {
            var f = r.LatLng.DEG_TO_RAD,
                e = this.MAX_LATITUDE,
                c = Math.max(Math.min(e, n.lat), -e),
                u = this.R_MAJOR,
                l = this.R_MINOR,
                a = n.lng * f * u,
                t = c * f,
                o = l / u,
                s = Math.sqrt(1 - o * o),
                i = s * Math.sin(t),
                h;
            return i = Math.pow((1 - i) / (1 + i), .5 * s), h = Math.tan(.5 * (.5 * Math.PI - t)) / i, t = -u * Math.log(h), new r.Point(a, t)
        },
        unproject: function(n) {
            for (var i, e = r.LatLng.RAD_TO_DEG, u = this.R_MAJOR, c = this.R_MINOR, l = n.x * e / u, o = c / u, s = Math.sqrt(1 - o * o), h = Math.exp(-n.y / u), t = Math.PI / 2 - 2 * Math.atan(h), a = 15, f = .1; Math.abs(f) > 1e-7 && --a > 0;) i = s * Math.sin(t), f = Math.PI / 2 - 2 * Math.atan(h * Math.pow((1 - i) / (1 + i), .5 * s)) - t, t += f;
            return new r.LatLng(t * e, l)
        }
    };
    r.CRS.EPSG3395 = r.extend({}, r.CRS, {
        code: "EPSG:3395",
        projection: r.Projection.Mercator,
        transformation: function() {
            var t = r.Projection.Mercator,
                i = t.R_MAJOR,
                n = .5 / (Math.PI * i);
            return new r.Transformation(n, .5, -n, .5)
        }()
    });
    r.TileLayer = r.Class.extend({
        includes: r.Mixin.Events,
        options: {
            minZoom: 0,
            maxZoom: 18,
            tileSize: 256,
            subdomains: "abc",
            errorTileUrl: "",
            attribution: "",
            zoomOffset: 0,
            opacity: 1,
            unloadInvisibleTiles: r.Browser.mobile,
            updateWhenIdle: r.Browser.mobile
        },
        initialize: function(n, t) {
            t = r.setOptions(this, t);
            t.detectRetina && r.Browser.retina && t.maxZoom > 0 && (t.tileSize = Math.floor(t.tileSize / 2), t.zoomOffset++, t.minZoom > 0 && t.minZoom--, this.options.maxZoom--);
            t.bounds && (t.bounds = r.latLngBounds(t.bounds));
            this._url = n;
            var i = this.options.subdomains;
            "string" == typeof i && (this.options.subdomains = i.split(""))
        },
        onAdd: function(n) {
            this._map = n;
            this._animated = n._zoomAnimated;
            this._initContainer();
            n.on({
                viewreset: this._reset,
                moveend: this._update
            }, this);
            this._animated && n.on({
                zoomanim: this._animateZoom,
                zoomend: this._endZoomAnim
            }, this);
            this.options.updateWhenIdle || (this._limitedUpdate = r.Util.limitExecByInterval(this._update, 150, this), n.on("move", this._limitedUpdate, this));
            this._reset();
            this._update()
        },
        addTo: function(n) {
            return n.addLayer(this), this
        },
        onRemove: function(n) {
            this._container.parentNode.removeChild(this._container);
            n.off({
                viewreset: this._reset,
                moveend: this._update
            }, this);
            this._animated && n.off({
                zoomanim: this._animateZoom,
                zoomend: this._endZoomAnim
            }, this);
            this.options.updateWhenIdle || n.off("move", this._limitedUpdate, this);
            this._container = null;
            this._map = null
        },
        bringToFront: function() {
            var n = this._map._panes.tilePane;
            return this._container && (n.appendChild(this._container), this._setAutoZIndex(n, Math.max)), this
        },
        bringToBack: function() {
            var n = this._map._panes.tilePane;
            return this._container && (n.insertBefore(this._container, n.firstChild), this._setAutoZIndex(n, Math.min)), this
        },
        getAttribution: function() {
            return this.options.attribution
        },
        getContainer: function() {
            return this._container
        },
        setOpacity: function(n) {
            return this.options.opacity = n, this._map && this._updateOpacity(), this
        },
        setZIndex: function(n) {
            return this.options.zIndex = n, this._updateZIndex(), this
        },
        setUrl: function(n, t) {
            return this._url = n, t || this.redraw(), this
        },
        redraw: function() {
            return this._map && (this._reset({
                hard: !0
            }), this._update()), this
        },
        _updateZIndex: function() {
            this._container && this.options.zIndex !== i && (this._container.style.zIndex = this.options.zIndex)
        },
        _setAutoZIndex: function(n, t) {
            for (var u, f = n.children, r = -t(1 / 0, -1 / 0), i = 0, e = f.length; e > i; i++) f[i] !== this._container && (u = parseInt(f[i].style.zIndex, 10), isNaN(u) || (r = t(r, u)));
            this.options.zIndex = this._container.style.zIndex = (isFinite(r) ? r : 0) + t(1, -1)
        },
        _updateOpacity: function() {
            var n, t = this._tiles;
            if (r.Browser.ielt9)
                for (n in t) r.DomUtil.setOpacity(t[n], this.options.opacity);
            else r.DomUtil.setOpacity(this._container, this.options.opacity)
        },
        _initContainer: function() {
            var t = this._map._panes.tilePane,
                n;
            this._container || ((this._container = r.DomUtil.create("div", "tmap-layer"), this._updateZIndex(), this._animated) ? (n = "tmap-tile-container", this._bgBuffer = r.DomUtil.create("div", n, this._container), this._tileContainer = r.DomUtil.create("div", n, this._container)) : this._tileContainer = this._container, t.appendChild(this._container), this.options.opacity < 1 && this._updateOpacity())
        },
        _reset: function(n) {
            for (var t in this._tiles) this.fire("tileunload", {
                tile: this._tiles[t]
            });
            this._tiles = {};
            this._tilesToLoad = 0;
            this.options.reuseTiles && (this._unusedTiles = []);
            this._tileContainer.innerHTML = "";
            this._animated && n && n.hard && this._clearBgBuffer();
            this._initContainer()
        },
        _getTileSize: function() {
            var n = this._map,
                r = n.getZoom() + this.options.zoomOffset,
                t = this.options.maxNativeZoom,
                i = this.options.tileSize;
            return t && r > t && (i = Math.round(n.getZoomScale(r) / n.getZoomScale(t) * i)), i
        },
        _update: function() {
            var n;
            if (this._map) {
                var t = this._map,
                    i = t.getPixelBounds(),
                    u = t.getZoom(),
                    f = this._getTileSize();
                u > this.options.maxZoom || u < this.options.minZoom || (n = r.bounds(i.min.divideBy(f)._floor(), i.max.divideBy(f)._floor()), this._addTilesFromCenterOut(n), (this.options.unloadInvisibleTiles || this.options.reuseTiles) && this._removeOtherTiles(n))
            }
        },
        _addTilesFromCenterOut: function(n) {
            for (var i, o, f = [], h = n.getCenter(), e, s, u = n.min.y; u <= n.max.y; u++)
                for (i = n.min.x; i <= n.max.x; i++) o = new r.Point(i, u), this._tileShouldBeLoaded(o) && f.push(o);
            if (e = f.length, 0 !== e) {
                for (f.sort(function(n, t) {
                        return n.distanceTo(h) - t.distanceTo(h)
                    }), s = t.createDocumentFragment(), this._tilesToLoad || this.fire("loading"), this._tilesToLoad += e, i = 0; e > i; i++) this._addTile(f[i], s);
                this._tileContainer.appendChild(s)
            }
        },
        _tileShouldBeLoaded: function(n) {
            var t, i;
            if (n.x + ":" + n.y in this._tiles || (t = this.options, !t.continuousWorld && (i = this._getWrapTileNum(), t.noWrap && (n.x < 0 || n.x >= i.x) || n.y < 0 || n.y >= i.y))) return !1;
            if (t.bounds) {
                var r = t.tileSize,
                    e = n.multiplyBy(r),
                    o = e.add([r, r]),
                    u = this._map.unproject(e),
                    f = this._map.unproject(o);
                if (t.continuousWorld || t.noWrap || (u = u.wrap(), f = f.wrap()), !t.bounds.intersects([u, f])) return !1
            }
            return !0
        },
        _removeOtherTiles: function(n) {
            var t, i, r, u;
            for (u in this._tiles) t = u.split(":"), i = parseInt(t[0], 10), r = parseInt(t[1], 10), (i < n.min.x || i > n.max.x || r < n.min.y || r > n.max.y) && this._removeTile(u)
        },
        _removeTile: function(n) {
            var t = this._tiles[n];
            this.fire("tileunload", {
                tile: t,
                url: t.src
            });
            this.options.reuseTiles ? (r.DomUtil.removeClass(t, "tmap-tile-loaded"), this._unusedTiles.push(t)) : t.parentNode === this._tileContainer && this._tileContainer.removeChild(t);
            r.Browser.android || (t.onload = null, t.src = r.Util.emptyImageUrl);
            delete this._tiles[n]
        },
        _addTile: function(n, t) {
            var u = this._getTilePos(n),
                i = this._getTile();
            r.DomUtil.setPosition(i, u, r.Browser.chrome);
            this._tiles[n.x + ":" + n.y] = i;
            this._loadTile(i, n);
            i.parentNode !== this._tileContainer && t.appendChild(i)
        },
        _getZoomForUrl: function() {
            var n = this.options,
                t = this._map.getZoom();
            return n.zoomReverse && (t = n.maxZoom - t), t += n.zoomOffset, n.maxNativeZoom ? Math.min(t, n.maxNativeZoom) : t
        },
        _getTilePos: function(n) {
            var t = this._map.getPixelOrigin(),
                i = this._getTileSize();
            return n.multiplyBy(i).subtract(t)
        },
        getTileUrl: function(n) {
            return r.Util.template(this._url, r.extend({
                s: this._getSubdomain(n),
                z: n.z,
                x: n.x,
                y: n.y
            }, this.options))
        },
        _getWrapTileNum: function() {
            var n = this._map.options.crs,
                t = n.getSize(this._map.getZoom());
            return t.divideBy(this._getTileSize())._floor()
        },
        _adjustTilePoint: function(n) {
            var t = this._getWrapTileNum();
            this.options.continuousWorld || this.options.noWrap || (n.x = (n.x % t.x + t.x) % t.x);
            this.options.tms && (n.y = t.y - n.y - 1);
            n.z = this._getZoomForUrl()
        },
        _getSubdomain: function(n) {
            var t = Math.abs(n.x + n.y) % this.options.subdomains.length;
            return this.options.subdomains[t]
        },
        _getTile: function() {
            if (this.options.reuseTiles && this._unusedTiles.length > 0) {
                var n = this._unusedTiles.pop();
                return this._resetTile(n), n
            }
            return this._createTile()
        },
        _resetTile: function() {},
        _createTile: function() {
            var n = r.DomUtil.create("img", "tmap-tile");
            return n.style.width = n.style.height = this._getTileSize() + "px", n.galleryimg = "no", n.onselectstart = n.onmousemove = r.Util.falseFn, r.Browser.ielt9 && this.options.opacity !== i && r.DomUtil.setOpacity(n, this.options.opacity), r.Browser.mobileWebkit3d && (n.style.WebkitBackfaceVisibility = "hidden"), n
        },
        _loadTile: function(n, t) {
            n._layer = this;
            n.onload = this._tileOnLoad;
            n.onerror = this._tileOnError;
            this._adjustTilePoint(t);
            n.src = this.getTileUrl(t);
            this.fire("tileloadstart", {
                tile: n,
                url: n.src
            })
        },
        _tileLoaded: function() {
            this._tilesToLoad--;
            this._animated && r.DomUtil.addClass(this._tileContainer, "tmap-zoom-animated");
            this._tilesToLoad || (this.fire("load"), this._animated && (clearTimeout(this._clearBgBufferTimer), this._clearBgBufferTimer = setTimeout(r.bind(this._clearBgBuffer, this), 500)))
        },
        _tileOnLoad: function() {
            var n = this._layer;
            this.src !== r.Util.emptyImageUrl && (r.DomUtil.addClass(this, "tmap-tile-loaded"), n.fire("tileload", {
                tile: this,
                url: this.src
            }));
            n._tileLoaded()
        },
        _tileOnError: function() {
            var n = this._layer,
                t;
            n.fire("tileerror", {
                tile: this,
                url: this.src
            });
            t = n.options.errorTileUrl;
            t && (this.src = t);
            n._tileLoaded()
        }
    });
    r.tileLayer = function(n, t) {
        return new r.TileLayer(n, t)
    };
    r.TileLayer.WMS = r.TileLayer.extend({
        defaultWmsParams: {
            service: "WMS",
            request: "GetMap",
            version: "1.1.1",
            layers: "",
            styles: "",
            format: "image/jpeg",
            transparent: !1
        },
        initialize: function(n, t) {
            var i, f, u;
            this._url = n;
            i = r.extend({}, this.defaultWmsParams);
            f = t.tileSize || this.options.tileSize;
            i.width = i.height = t.detectRetina && r.Browser.retina ? 2 * f : f;
            for (u in t) this.options.hasOwnProperty(u) || "crs" === u || (i[u] = t[u]);
            this.wmsParams = i;
            r.setOptions(this, t)
        },
        onAdd: function(n) {
            this._crs = this.options.crs || n.options.crs;
            this._wmsVersion = parseFloat(this.wmsParams.version);
            var t = this._wmsVersion >= 1.3 ? "crs" : "srs";
            this.wmsParams[t] = this._crs.code;
            r.TileLayer.prototype.onAdd.call(this, n)
        },
        getTileUrl: function(n) {
            var f = this._map,
                u = this.options.tileSize,
                e = n.multiplyBy(u),
                s = e.add([u, u]),
                t = this._crs.project(f.unproject(e, n.z)),
                i = this._crs.project(f.unproject(s, n.z)),
                h = this._wmsVersion >= 1.3 && this._crs === r.CRS.EPSG4326 ? [i.y, t.x, t.y, i.x].join(",") : [t.x, i.y, i.x, t.y].join(","),
                o = r.Util.template(this._url, {
                    s: this._getSubdomain(n)
                });
            return o + r.Util.getParamString(this.wmsParams, o, !0) + "&BBOX=" + h
        },
        setParams: function(n, t) {
            return r.extend(this.wmsParams, n), t || this.redraw(), this
        }
    });
    r.tileLayer.wms = function(n, t) {
        return new r.TileLayer.WMS(n, t)
    };
    r.TileLayer.Canvas = r.TileLayer.extend({
        options: {
            async: !1
        },
        initialize: function(n) {
            r.setOptions(this, n)
        },
        redraw: function() {
            this._map && (this._reset({
                hard: !0
            }), this._update());
            for (var n in this._tiles) this._redrawTile(this._tiles[n]);
            return this
        },
        _redrawTile: function(n) {
            this.drawTile(n, n._tilePoint, this._map._zoom)
        },
        _createTile: function() {
            var n = r.DomUtil.create("canvas", "tmap-tile");
            return n.width = n.height = this.options.tileSize, n.onselectstart = n.onmousemove = r.Util.falseFn, n
        },
        _loadTile: function(n, t) {
            n._layer = this;
            n._tilePoint = t;
            this._redrawTile(n);
            this.options.async || this.tileDrawn(n)
        },
        drawTile: function() {},
        tileDrawn: function(n) {
            this._tileOnLoad.call(n)
        }
    });
    r.tileLayer.canvas = function(n) {
        return new r.TileLayer.Canvas(n)
    };
    r.ImageOverlay = r.Class.extend({
        includes: r.Mixin.Events,
        options: {
            opacity: 1
        },
        initialize: function(n, t, i) {
            this._url = n;
            this._bounds = r.latLngBounds(t);
            r.setOptions(this, i)
        },
        onAdd: function(n) {
            this._map = n;
            this._image || this._initImage();
            n._panes.overlayPane.appendChild(this._image);
            n.on("viewreset", this._reset, this);
            n.options.zoomAnimation && r.Browser.any3d && n.on("zoomanim", this._animateZoom, this);
            this._reset()
        },
        onRemove: function(n) {
            n.getPanes().overlayPane.removeChild(this._image);
            n.off("viewreset", this._reset, this);
            n.options.zoomAnimation && n.off("zoomanim", this._animateZoom, this)
        },
        addTo: function(n) {
            return n.addLayer(this), this
        },
        setOpacity: function(n) {
            return this.options.opacity = n, this._updateOpacity(), this
        },
        bringToFront: function() {
            return this._image && this._map._panes.overlayPane.appendChild(this._image), this
        },
        bringToBack: function() {
            var n = this._map._panes.overlayPane;
            return this._image && n.insertBefore(this._image, n.firstChild), this
        },
        setUrl: function(n) {
            this._url = n;
            this._image.src = this._url
        },
        getAttribution: function() {
            return this.options.attribution
        },
        _initImage: function() {
            this._image = r.DomUtil.create("img", "tmap-image-layer");
            this._map.options.zoomAnimation && r.Browser.any3d ? r.DomUtil.addClass(this._image, "tmap-zoom-animated") : r.DomUtil.addClass(this._image, "tmap-zoom-hide");
            this._updateOpacity();
            r.extend(this._image, {
                galleryimg: "no",
                onselectstart: r.Util.falseFn,
                onmousemove: r.Util.falseFn,
                onload: r.bind(this._onImageLoad, this),
                src: this._url
            })
        },
        _animateZoom: function(n) {
            var t = this._map,
                f = this._image,
                i = t.getZoomScale(n.zoom),
                e = this._bounds.getNorthWest(),
                o = this._bounds.getSouthEast(),
                u = t._latLngToNewLayerPoint(e, n.zoom, n.center),
                s = t._latLngToNewLayerPoint(o, n.zoom, n.center)._subtract(u),
                h = u._add(s._multiplyBy(.5 * (1 - 1 / i)));
            f.style[r.DomUtil.TRANSFORM] = r.DomUtil.getTranslateString(h) + " scale(" + i + ") "
        },
        _reset: function() {
            var n = this._image,
                t = this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
                i = this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(t);
            r.DomUtil.setPosition(n, t);
            n.style.width = i.x + "px";
            n.style.height = i.y + "px"
        },
        _onImageLoad: function() {
            this.fire("load")
        },
        _updateOpacity: function() {
            r.DomUtil.setOpacity(this._image, this.options.opacity)
        }
    });
    r.imageOverlay = function(n, t, i) {
        return new r.ImageOverlay(n, t, i)
    };
    r.Icon = r.Class.extend({
        options: {
            className: ""
        },
        initialize: function(n) {
            r.setOptions(this, n)
        },
        createIcon: function(n) {
            return this._createIcon("icon", n)
        },
        createShadow: function(n) {
            return this._createIcon("shadow", n)
        },
        _createIcon: function(n, t) {
            var i = this._getIconUrl(n),
                r;
            if (!i) {
                if ("icon" === n) throw new Error("iconUrl not set in Icon options (see the docs).");
                return null
            }
            return r = t && "IMG" === t.tagName ? this._createImg(i, t) : this._createImg(i), this._setIconStyles(r, n), r
        },
        _setIconStyles: function(n, t) {
            var i, u = this.options,
                f = r.point(u[t + "Size"]);
            i = r.point("shadow" === t ? u.shadowAnchor || u.iconAnchor : u.iconAnchor);
            !i && f && (i = f.divideBy(2, !0));
            n.className = "tmap-marker-" + t + " " + u.className;
            i && (n.style.marginLeft = -i.x + "px", n.style.marginTop = -i.y + "px");
            f && (n.style.width = f.x + "px", n.style.height = f.y + "px")
        },
        _createImg: function(n, i) {
            return i = i || t.createElement("img"), i.src = n, i
        },
        _getIconUrl: function(n) {
            return r.Browser.retina && this.options[n + "RetinaUrl"] ? this.options[n + "RetinaUrl"] : this.options[n + "Url"]
        }
    });
    r.icon = function(n) {
        return new r.Icon(n)
    };
    r.Icon.Default = r.Icon.extend({
        options: {
            iconSize: [25, 41],
            iconAnchor: [12, 41],
            popupAnchor: [1, -34],
            shadowSize: [41, 41]
        },
        _getIconUrl: function(n) {
            var i = n + "Url",
                t;
            if (this.options[i]) return this.options[i];
            if (r.Browser.retina && "icon" === n && (n += "-2x"), t = r.Icon.Default.imagePath, !t) throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");
            return t + "/marker-" + n + ".png"
        }
    });
    r.Icon.Default.imagePath = function() {
        for (var i, o, r, f = t.getElementsByTagName("script"), e = /[\/^]tmap[\-\._]?([\w\-\._]*)\.js\??/, n = 0, u = f.length; u > n; n++)
            if (i = f[n].src, o = i.match(e)) return r = i.split(e)[0], (r ? r + "/" : "") + "images"
    }();
    r.Marker = r.Class.extend({
        includes: r.Mixin.Events,
        options: {
            icon: new r.Icon.Default,
            title: "",
            alt: "",
            clickable: !0,
            draggable: !1,
            keyboard: !0,
            zIndexOffset: 0,
            opacity: 1,
            riseOnHover: !1,
            riseOffset: 250
        },
        initialize: function(n, t) {
            r.setOptions(this, t);
            this._latlng = r.latLng(n)
        },
        onAdd: function(n) {
            this._map = n;
            n.on("viewreset", this.update, this);
            this._initIcon();
            this.update();
            this.fire("add");
            n.options.zoomAnimation && n.options.markerZoomAnimation && n.on("zoomanim", this._animateZoom, this)
        },
        addTo: function(n) {
            return n.addLayer(this), this
        },
        onRemove: function(n) {
            this.dragging && this.dragging.disable();
            this._removeIcon();
            this._removeShadow();
            this.fire("remove");
            n.off({
                viewreset: this.update,
                zoomanim: this._animateZoom
            }, this);
            this._map = null
        },
        getLatLng: function() {
            return this._latlng
        },
        setLatLng: function(n) {
            return this._latlng = r.latLng(n), this.update(), this.fire("move", {
                latlng: this._latlng
            })
        },
        setZIndexOffset: function(n) {
            return this.options.zIndexOffset = n, this.update(), this
        },
        setIcon: function(n) {
            return this.options.icon = n, this._map && (this._initIcon(), this.update()), this._popup && this.bindPopup(this._popup), this
        },
        update: function() {
            if (this._icon) {
                var n = this._map.latLngToLayerPoint(this._latlng).round();
                this._setPos(n)
            }
            return this
        },
        _initIcon: function() {
            var n = this.options,
                e = this._map,
                h = e.options.zoomAnimation && e.options.markerZoomAnimation,
                o = h ? "tmap-zoom-animated" : "tmap-zoom-hide",
                t = n.icon.createIcon(this._icon),
                s = !1,
                i, u, f;
            t !== this._icon && (this._icon && this._removeIcon(), s = !0, n.title && (t.title = n.title), n.alt && (t.alt = n.alt));
            r.DomUtil.addClass(t, o);
            n.keyboard && (t.tabIndex = "0");
            this._icon = t;
            this._initInteraction();
            n.riseOnHover && r.DomEvent.on(t, "mouseover", this._bringToFront, this).on(t, "mouseout", this._resetZIndex, this);
            i = n.icon.createShadow(this._shadow);
            u = !1;
            i !== this._shadow && (this._removeShadow(), u = !0);
            i && r.DomUtil.addClass(i, o);
            this._shadow = i;
            n.opacity < 1 && this._updateOpacity();
            f = this._map._panes;
            s && f.markerPane.appendChild(this._icon);
            i && u && f.shadowPane.appendChild(this._shadow)
        },
        _removeIcon: function() {
            this.options.riseOnHover && r.DomEvent.off(this._icon, "mouseover", this._bringToFront).off(this._icon, "mouseout", this._resetZIndex);
            this._map._panes.markerPane.removeChild(this._icon);
            this._icon = null
        },
        _removeShadow: function() {
            this._shadow && this._map._panes.shadowPane.removeChild(this._shadow);
            this._shadow = null
        },
        _setPos: function(n) {
            r.DomUtil.setPosition(this._icon, n);
            this._shadow && r.DomUtil.setPosition(this._shadow, n);
            this._zIndex = n.y + this.options.zIndexOffset;
            this._resetZIndex()
        },
        _updateZIndex: function(n) {
            this._icon.style.zIndex = this._zIndex + n
        },
        _animateZoom: function(n) {
            var t = this._map._latLngToNewLayerPoint(this._latlng, n.zoom, n.center).round();
            this._setPos(t)
        },
        _initInteraction: function() {
            var n, i, t;
            if (this.options.clickable) {
                for (n = this._icon, i = ["dblclick", "mousedown", "mouseover", "mouseout", "contextmenu"], r.DomUtil.addClass(n, "tmap-clickable"), r.DomEvent.on(n, "click", this._onMouseClick, this), r.DomEvent.on(n, "keypress", this._onKeyPress, this), t = 0; t < i.length; t++) r.DomEvent.on(n, i[t], this._fireMouseEvent, this);
                r.Handler.MarkerDrag && (this.dragging = new r.Handler.MarkerDrag(this), this.options.draggable && this.dragging.enable())
            }
        },
        _onMouseClick: function(n) {
            var t = this.dragging && this.dragging.moved();
            (this.hasEventListeners(n.type) || t) && r.DomEvent.stopPropagation(n);
            t || (this.dragging && this.dragging._enabled || !this._map.dragging || !this._map.dragging.moved()) && this.fire(n.type, {
                originalEvent: n,
                latlng: this._latlng
            })
        },
        _onKeyPress: function(n) {
            13 === n.keyCode && this.fire("click", {
                originalEvent: n,
                latlng: this._latlng
            })
        },
        _fireMouseEvent: function(n) {
            this.fire(n.type, {
                originalEvent: n,
                latlng: this._latlng
            });
            "contextmenu" === n.type && this.hasEventListeners(n.type) && r.DomEvent.preventDefault(n);
            "mousedown" !== n.type ? r.DomEvent.stopPropagation(n) : r.DomEvent.preventDefault(n)
        },
        setOpacity: function(n) {
            return this.options.opacity = n, this._map && this._updateOpacity(), this
        },
        _updateOpacity: function() {
            r.DomUtil.setOpacity(this._icon, this.options.opacity);
            this._shadow && r.DomUtil.setOpacity(this._shadow, this.options.opacity)
        },
        _bringToFront: function() {
            this._updateZIndex(this.options.riseOffset)
        },
        _resetZIndex: function() {
            this._updateZIndex(0)
        }
    });
    r.marker = function(n, t) {
        return new r.Marker(n, t)
    };
    r.DivIcon = r.Icon.extend({
        options: {
            iconSize: [12, 12],
            className: "tmap-div-icon",
            html: !1
        },
        createIcon: function(n) {
            var r = n && "DIV" === n.tagName ? n : t.createElement("div"),
                i = this.options;
            return r.innerHTML = i.html !== !1 ? i.html : "", i.bgPos && (r.style.backgroundPosition = -i.bgPos.x + "px " + -i.bgPos.y + "px"), this._setIconStyles(r, "icon"), r
        },
        createShadow: function() {
            return null
        }
    });
    r.divIcon = function(n) {
        return new r.DivIcon(n)
    };
    r.Map.mergeOptions({
        closePopupOnClick: !0
    });
    r.Popup = r.Class.extend({
        includes: r.Mixin.Events,
        options: {
            minWidth: 50,
            maxWidth: 300,
            autoPan: !0,
            closeButton: !0,
            offset: [0, 7],
            autoPanPadding: [5, 5],
            keepInView: !1,
            className: "",
            zoomAnimation: !0
        },
        initialize: function(n, t) {
            r.setOptions(this, n);
            this._source = t;
            this._animated = r.Browser.any3d && this.options.zoomAnimation;
            this._isOpen = !1
        },
        onAdd: function(n) {
            this._map = n;
            this._container || this._initLayout();
            var t = n.options.fadeAnimation;
            t && r.DomUtil.setOpacity(this._container, 0);
            n._panes.popupPane.appendChild(this._container);
            n.on(this._getEvents(), this);
            this.update();
            t && r.DomUtil.setOpacity(this._container, 1);
            this.fire("open");
            n.fire("popupopen", {
                popup: this
            });
            this._source && this._source.fire("popupopen", {
                popup: this
            })
        },
        addTo: function(n) {
            return n.addLayer(this), this
        },
        openOn: function(n) {
            return n.openPopup(this), this
        },
        onRemove: function(n) {
            n._panes.popupPane.removeChild(this._container);
            r.Util.falseFn(this._container.offsetWidth);
            n.off(this._getEvents(), this);
            n.options.fadeAnimation && r.DomUtil.setOpacity(this._container, 0);
            this._map = null;
            this.fire("close");
            n.fire("popupclose", {
                popup: this
            });
            this._source && this._source.fire("popupclose", {
                popup: this
            })
        },
        getLatLng: function() {
            return this._latlng
        },
        setLatLng: function(n) {
            return this._latlng = r.latLng(n), this._map && (this._updatePosition(), this._adjustPan()), this
        },
        getContent: function() {
            return this._content
        },
        setContent: function(n) {
            return this._content = n, this.update(), this
        },
        update: function() {
            this._map && (this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan())
        },
        _getEvents: function() {
            var n = {
                viewreset: this._updatePosition
            };
            return this._animated && (n.zoomanim = this._zoomAnimation), ("closeOnClick" in this.options ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (n.preclick = this._close), this.options.keepInView && (n.moveend = this._adjustPan), n
        },
        _close: function() {
            this._map && this._map.closePopup(this)
        },
        _initLayout: function() {
            var t, n = "tmap-popup",
                f = n + " " + this.options.className + " tmap-zoom-" + (this._animated ? "animated" : "hide"),
                u = this._container = r.DomUtil.create("div", f),
                i;
            this.options.closeButton && (t = this._closeButton = r.DomUtil.create("a", n + "-close-button", u), t.href = "#close", t.innerHTML = "&#215;", r.DomEvent.disableClickPropagation(t), r.DomEvent.on(t, "click", this._onCloseButtonClick, this));
            i = this._wrapper = r.DomUtil.create("div", n + "-content-wrapper", u);
            r.DomEvent.disableClickPropagation(i);
            this._contentNode = r.DomUtil.create("div", n + "-content", i);
            r.DomEvent.disableScrollPropagation(this._contentNode);
            r.DomEvent.on(i, "contextmenu", r.DomEvent.stopPropagation);
            this._tipContainer = r.DomUtil.create("div", n + "-tip-container", u);
            this._tip = r.DomUtil.create("div", n + "-tip", this._tipContainer)
        },
        _updateContent: function() {
            if (this._content) {
                if ("string" == typeof this._content) this._contentNode.innerHTML = this._content;
                else {
                    for (; this._contentNode.hasChildNodes();) this._contentNode.removeChild(this._contentNode.firstChild);
                    this._contentNode.appendChild(this._content)
                }
                this.fire("contentupdate")
            }
        },
        _updateLayout: function() {
            var i = this._contentNode,
                n = i.style,
                t;
            n.width = "";
            n.whiteSpace = "nowrap";
            t = i.offsetWidth;
            t = Math.min(t, this.options.maxWidth);
            t = Math.max(t, this.options.minWidth);
            n.width = t + 1 + "px";
            n.whiteSpace = "";
            n.height = "";
            var e = i.offsetHeight,
                u = this.options.maxHeight,
                f = "tmap-popup-scrolled";
            u && e > u ? (n.height = u + "px", r.DomUtil.addClass(i, f)) : r.DomUtil.removeClass(i, f);
            this._containerWidth = this._container.offsetWidth
        },
        _updatePosition: function() {
            if (this._map) {
                var n = this._map.latLngToLayerPoint(this._latlng),
                    t = this._animated,
                    i = r.point(this.options.offset);
                t && r.DomUtil.setPosition(this._container, n);
                this._containerBottom = -i.y - (t ? 0 : n.y);
                this._containerLeft = -Math.round(this._containerWidth / 2) + i.x + (t ? 0 : n.x);
                this._container.style.bottom = this._containerBottom + "px";
                this._container.style.left = this._containerLeft + "px"
            }
        },
        _zoomAnimation: function(n) {
            var t = this._map._latLngToNewLayerPoint(this._latlng, n.zoom, n.center);
            r.DomUtil.setPosition(this._container, t)
        },
        _adjustPan: function() {
            if (this.options.autoPan) {
                var o = this._map,
                    s = this._container.offsetHeight,
                    h = this._containerWidth,
                    c = new r.Point(this._containerLeft, -s - this._containerBottom);
                this._animated && c._add(r.DomUtil.getPosition(this._container));
                var n = o.layerPointToContainerPoint(c),
                    l = r.point(this.options.autoPanPadding),
                    u = r.point(this.options.autoPanPaddingTopLeft || l),
                    f = r.point(this.options.autoPanPaddingBottomRight || l),
                    e = o.getSize(),
                    t = 0,
                    i = 0;
                n.x + h + f.x > e.x && (t = n.x + h - e.x + f.x);
                n.x - t - u.x < 0 && (t = n.x - u.x);
                n.y + s + f.y > e.y && (i = n.y + s - e.y + f.y);
                n.y - i - u.y < 0 && (i = n.y - u.y);
                (t || i) && o.fire("autopanstart").panBy([t, i])
            }
        },
        _onCloseButtonClick: function(n) {
            this._close();
            r.DomEvent.stop(n)
        }
    });
    r.popup = function(n, t) {
        return new r.Popup(n, t)
    };
    r.Map.include({
        openPopup: function(n, t, i) {
            if (this.closePopup(), !(n instanceof r.Popup)) {
                var u = n;
                n = new r.Popup(i).setLatLng(t).setContent(u)
            }
            return n._isOpen = !0, this._popup = n, this.addLayer(n)
        },
        closePopup: function(n) {
            return n && n !== this._popup || (n = this._popup, this._popup = null), n && (this.removeLayer(n), n._isOpen = !1), this
        }
    });
    r.Marker.include({
        openPopup: function() {
            return this._popup && this._map && !this._map.hasLayer(this._popup) && (this._popup.setLatLng(this._latlng), this._map.openPopup(this._popup)), this
        },
        closePopup: function() {
            return this._popup && this._popup._close(), this
        },
        togglePopup: function() {
            return this._popup && (this._popup._isOpen ? this.closePopup() : this.openPopup()), this
        },
        bindPopup: function(n, t) {
            var i = r.point(this.options.icon.options.popupAnchor || [0, 0]);
            return i = i.add(r.Popup.prototype.options.offset), t && t.offset && (i = i.add(t.offset)), t = r.extend({
                offset: i
            }, t), this._popupHandlersAdded || (this.on("click", this.togglePopup, this).on("remove", this.closePopup, this).on("move", this._movePopup, this), this._popupHandlersAdded = !0), n instanceof r.Popup ? (r.setOptions(n, t), this._popup = n) : this._popup = new r.Popup(t, this).setContent(n), this
        },
        setPopupContent: function(n) {
            return this._popup && this._popup.setContent(n), this
        },
        unbindPopup: function() {
            return this._popup && (this._popup = null, this.off("click", this.togglePopup, this).off("remove", this.closePopup, this).off("move", this._movePopup, this), this._popupHandlersAdded = !1), this
        },
        getPopup: function() {
            return this._popup
        },
        _movePopup: function(n) {
            this._popup.setLatLng(n.latlng)
        }
    });
    r.LayerGroup = r.Class.extend({
        initialize: function(n) {
            this._layers = {};
            var t, i;
            if (n)
                for (t = 0, i = n.length; i > t; t++) this.addLayer(n[t])
        },
        addLayer: function(n) {
            var t = this.getLayerId(n);
            return this._layers[t] = n, this._map && this._map.addLayer(n), this
        },
        removeLayer: function(n) {
            var t = n in this._layers ? n : this.getLayerId(n);
            return this._map && this._layers[t] && this._map.removeLayer(this._layers[t]), delete this._layers[t], this
        },
        hasLayer: function(n) {
            return n ? n in this._layers || this.getLayerId(n) in this._layers : !1
        },
        clearLayers: function() {
            return this.eachLayer(this.removeLayer, this), this
        },
        invoke: function(n) {
            var i, t, r = Array.prototype.slice.call(arguments, 1);
            for (i in this._layers) t = this._layers[i], t[n] && t[n].apply(t, r);
            return this
        },
        onAdd: function(n) {
            this._map = n;
            this.eachLayer(n.addLayer, n)
        },
        onRemove: function(n) {
            this.eachLayer(n.removeLayer, n);
            this._map = null
        },
        addTo: function(n) {
            return n.addLayer(this), this
        },
        eachLayer: function(n, t) {
            for (var i in this._layers) n.call(t, this._layers[i]);
            return this
        },
        getLayer: function(n) {
            return this._layers[n]
        },
        getLayers: function() {
            var n = [],
                t;
            for (t in this._layers) n.push(this._layers[t]);
            return n
        },
        setZIndex: function(n) {
            return this.invoke("setZIndex", n)
        },
        getLayerId: function(n) {
            return r.stamp(n)
        }
    });
    r.layerGroup = function(n) {
        return new r.LayerGroup(n)
    };
    r.FeatureGroup = r.LayerGroup.extend({
        includes: r.Mixin.Events,
        statics: {
            EVENTS: "click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"
        },
        addLayer: function(n) {
            return this.hasLayer(n) ? this : ("on" in n && n.on(r.FeatureGroup.EVENTS, this._propagateEvent, this), r.LayerGroup.prototype.addLayer.call(this, n), this._popupContent && n.bindPopup && n.bindPopup(this._popupContent, this._popupOptions), this.fire("layeradd", {
                layer: n
            }))
        },
        removeLayer: function(n) {
            return this.hasLayer(n) ? (n in this._layers && (n = this._layers[n]), n.off(r.FeatureGroup.EVENTS, this._propagateEvent, this), r.LayerGroup.prototype.removeLayer.call(this, n), this._popupContent && this.invoke("unbindPopup"), this.fire("layerremove", {
                layer: n
            })) : this
        },
        bindPopup: function(n, t) {
            return this._popupContent = n, this._popupOptions = t, this.invoke("bindPopup", n, t)
        },
        openPopup: function(n) {
            for (var t in this._layers) {
                this._layers[t].openPopup(n);
                break
            }
            return this
        },
        setStyle: function(n) {
            return this.invoke("setStyle", n)
        },
        bringToFront: function() {
            return this.invoke("bringToFront")
        },
        bringToBack: function() {
            return this.invoke("bringToBack")
        },
        getBounds: function() {
            var n = new r.LatLngBounds;
            return this.eachLayer(function(t) {
                n.extend(t instanceof r.Marker ? t.getLatLng() : t.getBounds())
            }), n
        },
        _propagateEvent: function(n) {
            n = r.extend({
                layer: n.target,
                target: this
            }, n);
            this.fire(n.type, n)
        }
    });
    r.featureGroup = function(n) {
        return new r.FeatureGroup(n)
    };
    r.Path = r.Class.extend({
        includes: [r.Mixin.Events],
        statics: {
            CLIP_PADDING: function() {
                var t = r.Browser.mobile ? 1280 : 2e3,
                    i = (t / Math.max(n.outerWidth, n.outerHeight) - 1) / 2;
                return Math.max(0, Math.min(.5, i))
            }()
        },
        options: {
            stroke: !0,
            color: "#0033ff",
            dashArray: null,
            lineCap: null,
            lineJoin: null,
            weight: 5,
            opacity: .5,
            fill: !1,
            fillColor: null,
            fillOpacity: .2,
            clickable: !0
        },
        initialize: function(n) {
            r.setOptions(this, n)
        },
        onAdd: function(n) {
            this._map = n;
            this._container || (this._initElements(), this._initEvents());
            this.projectLatlngs();
            this._updatePath();
            this._container && this._map._pathRoot.appendChild(this._container);
            this.fire("add");
            n.on({
                viewreset: this.projectLatlngs,
                moveend: this._updatePath
            }, this)
        },
        addTo: function(n) {
            return n.addLayer(this), this
        },
        onRemove: function(n) {
            n._pathRoot.removeChild(this._container);
            this.fire("remove");
            this._map = null;
            r.Browser.vml && (this._container = null, this._stroke = null, this._fill = null);
            n.off({
                viewreset: this.projectLatlngs,
                moveend: this._updatePath
            }, this)
        },
        projectLatlngs: function() {},
        setStyle: function(n) {
            return r.setOptions(this, n), this._container && this._updateStyle(), this
        },
        redraw: function() {
            return this._map && (this.projectLatlngs(), this._updatePath()), this
        }
    });
    r.Map.include({
        _updatePathViewport: function() {
            var n = r.Path.CLIP_PADDING,
                t = this.getSize(),
                u = r.DomUtil.getPosition(this._mapPane),
                i = u.multiplyBy(-1)._subtract(t.multiplyBy(n)._round()),
                f = i.add(t.multiplyBy(1 + 2 * n)._round());
            this._pathViewport = new r.Bounds(i, f)
        }
    });
    r.Path.SVG_NS = "http://www.w3.org/2000/svg";
    r.Browser.svg = !(!t.createElementNS || !t.createElementNS(r.Path.SVG_NS, "svg").createSVGRect);
    r.Path = r.Path.extend({
        statics: {
            SVG: r.Browser.svg
        },
        bringToFront: function() {
            var t = this._map._pathRoot,
                n = this._container;
            return n && t.lastChild !== n && t.appendChild(n), this
        },
        bringToBack: function() {
            var t = this._map._pathRoot,
                n = this._container,
                i = t.firstChild;
            return n && i !== n && t.insertBefore(n, i), this
        },
        getPathString: function() {},
        _createElement: function(n) {
            return t.createElementNS(r.Path.SVG_NS, n)
        },
        _initElements: function() {
            this._map._initPathRoot();
            this._initPath();
            this._initStyle()
        },
        _initPath: function() {
            this._container = this._createElement("g");
            this._path = this._createElement("path");
            this.options.className && r.DomUtil.addClass(this._path, this.options.className);
            this._container.appendChild(this._path)
        },
        _initStyle: function() {
            this.options.stroke && (this._path.setAttribute("stroke-linejoin", "round"), this._path.setAttribute("stroke-linecap", "round"));
            this.options.fill && this._path.setAttribute("fill-rule", "evenodd");
            this.options.pointerEvents && this._path.setAttribute("pointer-events", this.options.pointerEvents);
            this.options.clickable || this.options.pointerEvents || this._path.setAttribute("pointer-events", "none");
            this._updateStyle()
        },
        _updateStyle: function() {
            this.options.stroke ? (this._path.setAttribute("stroke", this.options.color), this._path.setAttribute("stroke-opacity", this.options.opacity), this._path.setAttribute("stroke-width", this.options.weight), this.options.dashArray ? this._path.setAttribute("stroke-dasharray", this.options.dashArray) : this._path.removeAttribute("stroke-dasharray"), this.options.lineCap && this._path.setAttribute("stroke-linecap", this.options.lineCap), this.options.lineJoin && this._path.setAttribute("stroke-linejoin", this.options.lineJoin)) : this._path.setAttribute("stroke", "none");
            this.options.fill ? (this._path.setAttribute("fill", this.options.fillColor || this.options.color), this._path.setAttribute("fill-opacity", this.options.fillOpacity)) : this._path.setAttribute("fill", "none")
        },
        _updatePath: function() {
            var n = this.getPathString();
            n || (n = "M0 0");
            this._path.setAttribute("d", n)
        },
        _initEvents: function() {
            if (this.options.clickable) {
                (r.Browser.svg || !r.Browser.vml) && r.DomUtil.addClass(this._path, "tmap-clickable");
                r.DomEvent.on(this._container, "click", this._onMouseClick, this);
                for (var t = ["dblclick", "mousedown", "mouseover", "mouseout", "mousemove", "contextmenu"], n = 0; n < t.length; n++) r.DomEvent.on(this._container, t[n], this._fireMouseEvent, this)
            }
        },
        _onMouseClick: function(n) {
            this._map.dragging && this._map.dragging.moved() || this._fireMouseEvent(n)
        },
        _fireMouseEvent: function(n) {
            if (this.hasEventListeners(n.type)) {
                var t = this._map,
                    i = t.mouseEventToContainerPoint(n),
                    u = t.containerPointToLayerPoint(i),
                    f = t.layerPointToLatLng(u);
                this.fire(n.type, {
                    latlng: f,
                    layerPoint: u,
                    containerPoint: i,
                    originalEvent: n
                });
                "contextmenu" === n.type && r.DomEvent.preventDefault(n);
                "mousemove" !== n.type && r.DomEvent.stopPropagation(n)
            }
        }
    });
    r.Map.include({
        _initPathRoot: function() {
            this._pathRoot || (this._pathRoot = r.Path.prototype._createElement("svg"), this._panes.overlayPane.appendChild(this._pathRoot), this.options.zoomAnimation && r.Browser.any3d ? (r.DomUtil.addClass(this._pathRoot, "tmap-zoom-animated"), this.on({
                zoomanim: this._animatePathZoom,
                zoomend: this._endPathZoom
            })) : r.DomUtil.addClass(this._pathRoot, "tmap-zoom-hide"), this.on("moveend", this._updateSvgViewport), this._updateSvgViewport())
        },
        _animatePathZoom: function(n) {
            var t = this.getZoomScale(n.zoom),
                i = this._getCenterOffset(n.center)._multiplyBy(-t)._add(this._pathViewport.min);
            this._pathRoot.style[r.DomUtil.TRANSFORM] = r.DomUtil.getTranslateString(i) + " scale(" + t + ") ";
            this._pathZooming = !0
        },
        _endPathZoom: function() {
            this._pathZooming = !1
        },
        _updateSvgViewport: function() {
            if (!this._pathZooming) {
                this._updatePathViewport();
                var i = this._pathViewport,
                    t = i.min,
                    u = i.max,
                    f = u.x - t.x,
                    e = u.y - t.y,
                    n = this._pathRoot,
                    o = this._panes.overlayPane;
                r.Browser.mobileWebkit && o.removeChild(n);
                r.DomUtil.setPosition(n, t);
                n.setAttribute("width", f);
                n.setAttribute("height", e);
                n.setAttribute("viewBox", [t.x, t.y, f, e].join(" "));
                r.Browser.mobileWebkit && o.appendChild(n)
            }
        }
    });
    r.Path.include({
        bindPopup: function(n, t) {
            return n instanceof r.Popup ? this._popup = n : ((!this._popup || t) && (this._popup = new r.Popup(t, this)), this._popup.setContent(n)), this._popupHandlersAdded || (this.on("click", this._openPopup, this).on("remove", this.closePopup, this), this._popupHandlersAdded = !0), this
        },
        unbindPopup: function() {
            return this._popup && (this._popup = null, this.off("click", this._openPopup).off("remove", this.closePopup), this._popupHandlersAdded = !1), this
        },
        openPopup: function(n) {
            return this._popup && (n = n || this._latlng || this._latlngs[Math.floor(this._latlngs.length / 2)], this._openPopup({
                latlng: n
            })), this
        },
        closePopup: function() {
            return this._popup && this._popup._close(), this
        },
        _openPopup: function(n) {
            this._popup.setLatLng(n.latlng);
            this._map.openPopup(this._popup)
        }
    });
    r.Browser.vml = !r.Browser.svg && function() {
        var i, n;
        try {
            return i = t.createElement("div"), i.innerHTML = '<v:shape adj="1"/>', n = i.firstChild, n.style.behavior = "url(#default#VML)", n && "object" == typeof n.adj
        } catch (r) {
            return !1
        }
    }();
    r.Path = r.Browser.svg || !r.Browser.vml ? r.Path : r.Path.extend({
        statics: {
            VML: !0,
            CLIP_PADDING: .02
        },
        _createElement: function() {
            try {
                return t.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"),
                    function(n) {
                        return t.createElement("<lvml:" + n + ' class="lvml">')
                    }
            } catch (n) {
                return function(n) {
                    return t.createElement("<" + n + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')
                }
            }
        }(),
        _initPath: function() {
            var n = this._container = this._createElement("shape");
            r.DomUtil.addClass(n, "tmap-vml-shape" + (this.options.className ? " " + this.options.className : ""));
            this.options.clickable && r.DomUtil.addClass(n, "tmap-clickable");
            n.coordsize = "1 1";
            this._path = this._createElement("path");
            n.appendChild(this._path);
            this._map._pathRoot.appendChild(n)
        },
        _initStyle: function() {
            this._updateStyle()
        },
        _updateStyle: function() {
            var t = this._stroke,
                i = this._fill,
                n = this.options,
                u = this._container;
            u.stroked = n.stroke;
            u.filled = n.fill;
            n.stroke ? (t || (t = this._stroke = this._createElement("stroke"), t.endcap = "round", u.appendChild(t)), t.weight = n.weight + "px", t.color = n.color, t.opacity = n.opacity, t.dashStyle = n.dashArray ? r.Util.isArray(n.dashArray) ? n.dashArray.join(" ") : n.dashArray.replace(/( *, *)/g, " ") : "", n.lineCap && (t.endcap = n.lineCap.replace("butt", "flat")), n.lineJoin && (t.joinstyle = n.lineJoin)) : t && (u.removeChild(t), this._stroke = null);
            n.fill ? (i || (i = this._fill = this._createElement("fill"), u.appendChild(i)), i.color = n.fillColor || n.color, i.opacity = n.fillOpacity) : i && (u.removeChild(i), this._fill = null)
        },
        _updatePath: function() {
            var n = this._container.style;
            n.display = "none";
            this._path.v = this.getPathString() + " ";
            n.display = ""
        }
    });
    r.Map.include(r.Browser.svg || !r.Browser.vml ? {} : {
        _initPathRoot: function() {
            if (!this._pathRoot) {
                var n = this._pathRoot = t.createElement("div");
                n.className = "tmap-vml-container";
                this._panes.overlayPane.appendChild(n);
                this.on("moveend", this._updatePathViewport);
                this._updatePathViewport()
            }
        }
    });
    r.Browser.canvas = function() {
        return !!t.createElement("canvas").getContext
    }();
    r.Path = r.Path.SVG && !n.L_PREFER_CANVAS || !r.Browser.canvas ? r.Path : r.Path.extend({
        statics: {
            CANVAS: !0,
            SVG: !1
        },
        redraw: function() {
            return this._map && (this.projectLatlngs(), this._requestUpdate()), this
        },
        setStyle: function(n) {
            return r.setOptions(this, n), this._map && (this._updateStyle(), this._requestUpdate()), this
        },
        onRemove: function(n) {
            n.off("viewreset", this.projectLatlngs, this).off("moveend", this._updatePath, this);
            this.options.clickable && (this._map.off("click", this._onClick, this), this._map.off("mousemove", this._onMouseMove, this));
            this._requestUpdate();
            this._map = null
        },
        _requestUpdate: function() {
            this._map && !r.Path._updateRequest && (r.Path._updateRequest = r.Util.requestAnimFrame(this._fireMapMoveEnd, this._map))
        },
        _fireMapMoveEnd: function() {
            r.Path._updateRequest = null;
            this.fire("moveend")
        },
        _initElements: function() {
            this._map._initPathRoot();
            this._ctx = this._map._canvasCtx
        },
        _updateStyle: function() {
            var n = this.options;
            n.stroke && (this._ctx.lineWidth = n.weight, this._ctx.strokeStyle = n.color);
            n.fill && (this._ctx.fillStyle = n.fillColor || n.color)
        },
        _drawPath: function() {
            var n, t, u, f, i, e;
            for (this._ctx.beginPath(), n = 0, u = this._parts.length; u > n; n++) {
                for (t = 0, f = this._parts[n].length; f > t; t++) i = this._parts[n][t], e = (0 === t ? "move" : "line") + "To", this._ctx[e](i.x, i.y);
                this instanceof r.Polygon && this._ctx.closePath()
            }
        },
        _checkIfEmpty: function() {
            return !this._parts.length
        },
        _updatePath: function() {
            if (!this._checkIfEmpty()) {
                var n = this._ctx,
                    t = this.options;
                this._drawPath();
                n.save();
                this._updateStyle();
                t.fill && (n.globalAlpha = t.fillOpacity, n.fill());
                t.stroke && (n.globalAlpha = t.opacity, n.stroke());
                n.restore()
            }
        },
        _initEvents: function() {
            this.options.clickable && (this._map.on("mousemove", this._onMouseMove, this), this._map.on("click", this._onClick, this))
        },
        _onClick: function(n) {
            this._containsPoint(n.layerPoint) && this.fire("click", n)
        },
        _onMouseMove: function(n) {
            this._map && !this._map._animatingZoom && (this._containsPoint(n.layerPoint) ? (this._ctx.canvas.style.cursor = "pointer", this._mouseInside = !0, this.fire("mouseover", n)) : this._mouseInside && (this._ctx.canvas.style.cursor = "", this._mouseInside = !1, this.fire("mouseout", n)))
        }
    });
    r.Map.include(r.Path.SVG && !n.L_PREFER_CANVAS || !r.Browser.canvas ? {} : {
        _initPathRoot: function() {
            var i, n = this._pathRoot;
            n || (n = this._pathRoot = t.createElement("canvas"), n.style.position = "absolute", i = this._canvasCtx = n.getContext("2d"), i.lineCap = "round", i.lineJoin = "round", this._panes.overlayPane.appendChild(n), this.options.zoomAnimation && (this._pathRoot.className = "tmap-zoom-animated", this.on("zoomanim", this._animatePathZoom), this.on("zoomend", this._endPathZoom)), this.on("moveend", this._updateCanvasViewport), this._updateCanvasViewport())
        },
        _updateCanvasViewport: function() {
            if (!this._pathZooming) {
                this._updatePathViewport();
                var i = this._pathViewport,
                    n = i.min,
                    u = i.max.subtract(n),
                    t = this._pathRoot;
                r.DomUtil.setPosition(t, n);
                t.width = u.x;
                t.height = u.y;
                t.getContext("2d").translate(-n.x, -n.y)
            }
        }
    });
    r.LineUtil = {
        simplify: function(n, t) {
            if (!t || !n.length) return n.slice();
            var i = t * t;
            return n = this._reducePoints(n, i), n = this._simplifyDP(n, i)
        },
        pointToSegmentDistance: function(n, t, i) {
            return Math.sqrt(this._sqClosestPointOnSegment(n, t, i, !0))
        },
        closestPointOnSegment: function(n, t, i) {
            return this._sqClosestPointOnSegment(n, t, i)
        },
        _simplifyDP: function(n, t) {
            var u = n.length,
                o = typeof Uint8Array != i + "" ? Uint8Array : Array,
                f = new o(u),
                r, e;
            for (f[0] = f[u - 1] = 1, this._simplifyDPStep(n, f, t, 0, u - 1), e = [], r = 0; u > r; r++) f[r] && e.push(n[r]);
            return e
        },
        _simplifyDPStep: function(n, t, i, r, u) {
            for (var e, o, s = 0, f = r + 1; u - 1 >= f; f++) o = this._sqClosestPointOnSegment(n[f], n[r], n[u], !0), o > s && (e = f, s = o);
            s > i && (t[e] = 1, this._simplifyDPStep(n, t, i, r, e), this._simplifyDPStep(n, t, i, e, u))
        },
        _reducePoints: function(n, t) {
            for (var r = [n[0]], i = 1, u = 0, f = n.length; f > i; i++) this._sqDist(n[i], n[u]) > t && (r.push(n[i]), u = i);
            return f - 1 > u && r.push(n[f - 1]), r
        },
        clipSegment: function(n, t, i, r) {
            var o, e, s, u = r ? this._lastCode : this._getBitCode(n, i),
                f = this._getBitCode(t, i);
            for (this._lastCode = f;;) {
                if (!(u | f)) return [n, t];
                if (u & f) return !1;
                o = u || f;
                e = this._getEdgeIntersection(n, t, o, i);
                s = this._getBitCode(e, i);
                o === u ? (n = e, u = s) : (t = e, f = s)
            }
        },
        _getEdgeIntersection: function(n, t, i, u) {
            var f = t.x - n.x,
                e = t.y - n.y,
                o = u.min,
                s = u.max;
            return 8 & i ? new r.Point(n.x + f * (s.y - n.y) / e, s.y) : 4 & i ? new r.Point(n.x + f * (o.y - n.y) / e, o.y) : 2 & i ? new r.Point(s.x, n.y + e * (s.x - n.x) / f) : 1 & i ? new r.Point(o.x, n.y + e * (o.x - n.x) / f) : void 0
        },
        _getBitCode: function(n, t) {
            var i = 0;
            return n.x < t.min.x ? i |= 1 : n.x > t.max.x && (i |= 2), n.y < t.min.y ? i |= 4 : n.y > t.max.y && (i |= 8), i
        },
        _sqDist: function(n, t) {
            var i = t.x - n.x,
                r = t.y - n.y;
            return i * i + r * r
        },
        _sqClosestPointOnSegment: function(n, t, i, u) {
            var h, o = t.x,
                s = t.y,
                f = i.x - o,
                e = i.y - s,
                c = f * f + e * e;
            return c > 0 && (h = ((n.x - o) * f + (n.y - s) * e) / c, h > 1 ? (o = i.x, s = i.y) : h > 0 && (o += f * h, s += e * h)), f = n.x - o, e = n.y - s, u ? f * f + e * e : new r.Point(o, s)
        }
    };
    r.Polyline = r.Path.extend({
        initialize: function(n, t) {
            r.Path.prototype.initialize.call(this, t);
            this._latlngs = this._convertLatLngs(n)
        },
        options: {
            smoothFactor: 1,
            noClip: !1
        },
        projectLatlngs: function() {
            this._originalPoints = [];
            for (var n = 0, t = this._latlngs.length; t > n; n++) this._originalPoints[n] = this._map.latLngToLayerPoint(this._latlngs[n])
        },
        getPathString: function() {
            for (var n = 0, i = this._parts.length, t = ""; i > n; n++) t += this._getPathPartStr(this._parts[n]);
            return t
        },
        getLatLngs: function() {
            return this._latlngs
        },
        setLatLngs: function(n) {
            return this._latlngs = this._convertLatLngs(n), this.redraw()
        },
        addLatLng: function(n) {
            return this._latlngs.push(r.latLng(n)), this.redraw()
        },
        spliceLatLngs: function() {
            var n = [].splice.apply(this._latlngs, arguments);
            return this._convertLatLngs(this._latlngs, !0), this.redraw(), n
        },
        closestLayerPoint: function(n) {
            for (var h, u, f, e = 1 / 0, c = this._parts, t = null, o = 0, l = c.length; l > o; o++)
                for (var s = c[o], i = 1, a = s.length; a > i; i++) u = s[i - 1], f = s[i], h = r.LineUtil._sqClosestPointOnSegment(n, u, f, !0), e > h && (e = h, t = r.LineUtil._sqClosestPointOnSegment(n, u, f));
            return t && (t.distance = Math.sqrt(e)), t
        },
        getBounds: function() {
            return new r.LatLngBounds(this.getLatLngs())
        },
        _convertLatLngs: function(n, t) {
            for (var f = t ? n : [], i = 0, u = n.length; u > i; i++) {
                if (r.Util.isArray(n[i]) && "number" != typeof n[i][0]) return;
                f[i] = r.latLng(n[i])
            }
            return f
        },
        _initEvents: function() {
            r.Path.prototype._initEvents.call(this)
        },
        _getPathPartStr: function(n) {
            for (var t, f = r.Path.VML, i = 0, e = n.length, u = ""; e > i; i++) t = n[i], f && t._round(), u += (i ? "L" : "M") + t.x + " " + t.y;
            return u
        },
        _clipPoints: function() {
            var n, t, i, u = this._originalPoints,
                e = u.length;
            if (this.options.noClip) return void(this._parts = [u]);
            this._parts = [];
            var f = this._parts,
                o = this._map._pathViewport,
                s = r.LineUtil;
            for (n = 0, t = 0; e - 1 > n; n++) i = s.clipSegment(u[n], u[n + 1], o, n), i && (f[t] = f[t] || [], f[t].push(i[0]), (i[1] !== u[n + 1] || n === e - 2) && (f[t].push(i[1]), t++))
        },
        _simplifyPoints: function() {
            for (var t = this._parts, i = r.LineUtil, n = 0, u = t.length; u > n; n++) t[n] = i.simplify(t[n], this.options.smoothFactor)
        },
        _updatePath: function() {
            this._map && (this._clipPoints(), this._simplifyPoints(), r.Path.prototype._updatePath.call(this))
        }
    });
    r.polyline = function(n, t) {
        return new r.Polyline(n, t)
    };
    r.PolyUtil = {};
    r.PolyUtil.clipPolygon = function(n, t) {
        for (var e, a, l, o, s, f, u, v = [1, 4, 2, 8], c = r.LineUtil, i = 0, h = n.length; h > i; i++) n[i]._code = c._getBitCode(n[i], t);
        for (l = 0; 4 > l; l++) {
            for (f = v[l], e = [], i = 0, h = n.length, a = h - 1; h > i; a = i++) o = n[i], s = n[a], o._code & f ? s._code & f || (u = c._getEdgeIntersection(s, o, f, t), u._code = c._getBitCode(u, t), e.push(u)) : (s._code & f && (u = c._getEdgeIntersection(s, o, f, t), u._code = c._getBitCode(u, t), e.push(u)), e.push(o));
            n = e
        }
        return n
    };
    r.Polygon = r.Polyline.extend({
        options: {
            fill: !0
        },
        initialize: function(n, t) {
            r.Polyline.prototype.initialize.call(this, n, t);
            this._initWithHoles(n)
        },
        _initWithHoles: function(n) {
            var t, u, i;
            if (n && r.Util.isArray(n[0]) && "number" != typeof n[0][0])
                for (this._latlngs = this._convertLatLngs(n[0]), this._holes = n.slice(1), t = 0, u = this._holes.length; u > t; t++) i = this._holes[t] = this._convertLatLngs(this._holes[t]), i[0].equals(i[i.length - 1]) && i.pop();
            n = this._latlngs;
            n.length >= 2 && n[0].equals(n[n.length - 1]) && n.pop()
        },
        projectLatlngs: function() {
            if (r.Polyline.prototype.projectLatlngs.call(this), this._holePoints = [], this._holes)
                for (var t, u, n = 0, i = this._holes.length; i > n; n++)
                    for (this._holePoints[n] = [], t = 0, u = this._holes[n].length; u > t; t++) this._holePoints[n][t] = this._map.latLngToLayerPoint(this._holes[n][t])
        },
        setLatLngs: function(n) {
            return n && r.Util.isArray(n[0]) && "number" != typeof n[0][0] ? (this._initWithHoles(n), this.redraw()) : r.Polyline.prototype.setLatLngs.call(this, n)
        },
        _clipPoints: function() {
            var f = this._originalPoints,
                i = [],
                n, u, t;
            if (this._parts = [f].concat(this._holePoints), !this.options.noClip) {
                for (n = 0, u = this._parts.length; u > n; n++) t = r.PolyUtil.clipPolygon(this._parts[n], this._map._pathViewport), t.length && i.push(t);
                this._parts = i
            }
        },
        _getPathPartStr: function(n) {
            var t = r.Polyline.prototype._getPathPartStr.call(this, n);
            return t + (r.Browser.svg ? "z" : "x")
        }
    });
    r.polygon = function(n, t) {
            return new r.Polygon(n, t)
        },
        function() {
            function n(n) {
                return r.FeatureGroup.extend({
                    initialize: function(n, t) {
                        this._layers = {};
                        this._options = t;
                        this.setLatLngs(n)
                    },
                    setLatLngs: function(t) {
                        var i = 0,
                            r = t.length;
                        for (this.eachLayer(function(n) {
                                r > i ? n.setLatLngs(t[i++]) : this.removeLayer(n)
                            }, this); r > i;) this.addLayer(new n(t[i++], this._options));
                        return this
                    },
                    getLatLngs: function() {
                        var n = [];
                        return this.eachLayer(function(t) {
                            n.push(t.getLatLngs())
                        }), n
                    }
                })
            }
            r.MultiPolyline = n(r.Polyline);
            r.MultiPolygon = n(r.Polygon);
            r.multiPolyline = function(n, t) {
                return new r.MultiPolyline(n, t)
            };
            r.multiPolygon = function(n, t) {
                return new r.MultiPolygon(n, t)
            }
        }();
    r.Rectangle = r.Polygon.extend({
        initialize: function(n, t) {
            r.Polygon.prototype.initialize.call(this, this._boundsToLatLngs(n), t)
        },
        setBounds: function(n) {
            this.setLatLngs(this._boundsToLatLngs(n))
        },
        _boundsToLatLngs: function(n) {
            return n = r.latLngBounds(n), [n.getSouthWest(), n.getNorthWest(), n.getNorthEast(), n.getSouthEast()]
        }
    });
    r.rectangle = function(n, t) {
        return new r.Rectangle(n, t)
    };
    r.Circle = r.Path.extend({
        initialize: function(n, t, i) {
            r.Path.prototype.initialize.call(this, i);
            this._latlng = r.latLng(n);
            this._mRadius = t
        },
        options: {
            fill: !0
        },
        setLatLng: function(n) {
            return this._latlng = r.latLng(n), this.redraw()
        },
        setRadius: function(n) {
            return this._mRadius = n, this.redraw()
        },
        projectLatlngs: function() {
            var t = this._getLngRadius(),
                n = this._latlng,
                i = this._map.latLngToLayerPoint([n.lat, n.lng - t]);
            this._point = this._map.latLngToLayerPoint(n);
            this._radius = Math.max(this._point.x - i.x, 1)
        },
        getBounds: function() {
            var t = this._getLngRadius(),
                i = this._mRadius / 40075017 * 360,
                n = this._latlng;
            return new r.LatLngBounds([n.lat - i, n.lng - t], [n.lat + i, n.lng + t])
        },
        getLatLng: function() {
            return this._latlng
        },
        getPathString: function() {
            var t = this._point,
                n = this._radius;
            return this._checkIfEmpty() ? "" : r.Browser.svg ? "M" + t.x + "," + (t.y - n) + "A" + n + "," + n + ",0,1,1," + (t.x - .1) + "," + (t.y - n) + " z" : (t._round(), n = Math.round(n), "AL " + t.x + "," + t.y + " " + n + "," + n + " 0,23592600")
        },
        getRadius: function() {
            return this._mRadius
        },
        _getLatRadius: function() {
            return this._mRadius / 40075017 * 360
        },
        _getLngRadius: function() {
            return this._getLatRadius() / Math.cos(r.LatLng.DEG_TO_RAD * this._latlng.lat)
        },
        _checkIfEmpty: function() {
            if (!this._map) return !1;
            var n = this._map._pathViewport,
                t = this._radius,
                i = this._point;
            return i.x - t > n.max.x || i.y - t > n.max.y || i.x + t < n.min.x || i.y + t < n.min.y
        }
    });
    r.circle = function(n, t, i) {
        return new r.Circle(n, t, i)
    };
    r.CircleMarker = r.Circle.extend({
        options: {
            radius: 10,
            weight: 2
        },
        initialize: function(n, t) {
            r.Circle.prototype.initialize.call(this, n, null, t);
            this._radius = this.options.radius
        },
        projectLatlngs: function() {
            this._point = this._map.latLngToLayerPoint(this._latlng)
        },
        _updateStyle: function() {
            r.Circle.prototype._updateStyle.call(this);
            this.setRadius(this.options.radius)
        },
        setLatLng: function(n) {
            return r.Circle.prototype.setLatLng.call(this, n), this._popup && this._popup._isOpen && this._popup.setLatLng(n), this
        },
        setRadius: function(n) {
            return this.options.radius = this._radius = n, this.redraw()
        },
        getRadius: function() {
            return this._radius
        }
    });
    r.circleMarker = function(n, t) {
        return new r.CircleMarker(n, t)
    };
    r.Polyline.include(r.Path.CANVAS ? {
        _containsPoint: function(n, t) {
            var u, i, e, s, o, h, f, c = this.options.weight / 2;
            for (r.Browser.touch && (c += 10), u = 0, s = this._parts.length; s > u; u++)
                for (f = this._parts[u], i = 0, o = f.length, e = o - 1; o > i; e = i++)
                    if ((t || 0 !== i) && (h = r.LineUtil.pointToSegmentDistance(n, f[e], f[i]), c >= h)) return !0;
            return !1
        }
    } : {});
    r.Polygon.include(r.Path.CANVAS ? {
        _containsPoint: function(n) {
            var i, t, u, f, e, o, c, s, h = !1;
            if (r.Polyline.prototype._containsPoint.call(this, n, !0)) return !0;
            for (f = 0, c = this._parts.length; c > f; f++)
                for (i = this._parts[f], e = 0, s = i.length, o = s - 1; s > e; o = e++) t = i[e], u = i[o], t.y > n.y != u.y > n.y && n.x < (u.x - t.x) * (n.y - t.y) / (u.y - t.y) + t.x && (h = !h);
            return h
        }
    } : {});
    r.Circle.include(r.Path.CANVAS ? {
        _drawPath: function() {
            var n = this._point;
            this._ctx.beginPath();
            this._ctx.arc(n.x, n.y, this._radius, 0, 2 * Math.PI, !1)
        },
        _containsPoint: function(n) {
            var t = this._point,
                i = this.options.stroke ? this.options.weight / 2 : 0;
            return n.distanceTo(t) <= this._radius + i
        }
    } : {});
    r.CircleMarker.include(r.Path.CANVAS ? {
        _updateStyle: function() {
            r.Path.prototype._updateStyle.call(this)
        }
    } : {});
    r.GeoJSON = r.FeatureGroup.extend({
        initialize: function(n, t) {
            r.setOptions(this, t);
            this._layers = {};
            n && this.addData(n)
        },
        addData: function(n) {
            var u, o, f, e = r.Util.isArray(n) ? n : n.features,
                t, i;
            if (e) {
                for (u = 0, o = e.length; o > u; u++) f = e[u], (f.geometries || f.geometry || f.features || f.coordinates) && this.addData(e[u]);
                return this
            }
            return t = this.options, !t.filter || t.filter(n) ? (i = r.GeoJSON.geometryToLayer(n, t.pointToLayer, t.coordsToLatLng, t), i.feature = r.GeoJSON.asFeature(n), i.defaultOptions = i.options, this.resetStyle(i), t.onEachFeature && t.onEachFeature(n, i), this.addLayer(i)) : void 0
        },
        resetStyle: function(n) {
            var t = this.options.style;
            t && (r.Util.extend(n.options, n.defaultOptions), this._setLayerStyle(n, t))
        },
        setStyle: function(n) {
            this.eachLayer(function(t) {
                this._setLayerStyle(t, n)
            }, this)
        },
        _setLayerStyle: function(n, t) {
            "function" == typeof t && (t = t(n.feature));
            n.setStyle && n.setStyle(t)
        }
    });
    r.extend(r.GeoJSON, {
        geometryToLayer: function(n, t, i, u) {
            var s, e, o, h, c = "Feature" === n.type ? n.geometry : n,
                f = c.coordinates,
                l = [];
            switch (i = i || this.coordsToLatLng, c.type) {
                case "Point":
                    return s = i(f), t ? t(n, s) : new r.Marker(s);
                case "MultiPoint":
                    for (o = 0, h = f.length; h > o; o++) s = i(f[o]), l.push(t ? t(n, s) : new r.Marker(s));
                    return new r.FeatureGroup(l);
                case "LineString":
                    return e = this.coordsToLatLngs(f, 0, i), new r.Polyline(e, u);
                case "Polygon":
                    if (2 === f.length && !f[1].length) throw new Error("Invalid GeoJSON object.");
                    return e = this.coordsToLatLngs(f, 1, i), new r.Polygon(e, u);
                case "MultiLineString":
                    return e = this.coordsToLatLngs(f, 1, i), new r.MultiPolyline(e, u);
                case "MultiPolygon":
                    return e = this.coordsToLatLngs(f, 2, i), new r.MultiPolygon(e, u);
                case "GeometryCollection":
                    for (o = 0, h = c.geometries.length; h > o; o++) l.push(this.geometryToLayer({
                        geometry: c.geometries[o],
                        type: "Feature",
                        properties: n.properties
                    }, t, i, u));
                    return new r.FeatureGroup(l);
                default:
                    throw new Error("Invalid GeoJSON object.");
            }
        },
        coordsToLatLng: function(n) {
            return new r.LatLng(n[1], n[0], n[2])
        },
        coordsToLatLngs: function(n, t, i) {
            for (var u, e = [], r = 0, f = n.length; f > r; r++) u = t ? this.coordsToLatLngs(n[r], t - 1, i) : (i || this.coordsToLatLng)(n[r]), e.push(u);
            return e
        },
        latLngToCoords: function(n) {
            var t = [n.lng, n.lat];
            return n.alt !== i && t.push(n.alt), t
        },
        latLngsToCoords: function(n) {
            for (var i = [], t = 0, u = n.length; u > t; t++) i.push(r.GeoJSON.latLngToCoords(n[t]));
            return i
        },
        getFeature: function(n, t) {
            return n.feature ? r.extend({}, n.feature, {
                geometry: t
            }) : r.GeoJSON.asFeature(t)
        },
        asFeature: function(n) {
            return "Feature" === n.type ? n : {
                type: "Feature",
                properties: {},
                geometry: n
            }
        }
    });
    f = {
        toGeoJSON: function() {
            return r.GeoJSON.getFeature(this, {
                type: "Point",
                coordinates: r.GeoJSON.latLngToCoords(this.getLatLng())
            })
        }
    };
    r.Marker.include(f);
    r.Circle.include(f);
    r.CircleMarker.include(f);
    r.Polyline.include({
        toGeoJSON: function() {
            return r.GeoJSON.getFeature(this, {
                type: "LineString",
                coordinates: r.GeoJSON.latLngsToCoords(this.getLatLngs())
            })
        }
    });
    r.Polygon.include({
            toGeoJSON: function() {
                var n, u, t, i = [r.GeoJSON.latLngsToCoords(this.getLatLngs())];
                if (i[0].push(i[0][0]), this._holes)
                    for (n = 0, u = this._holes.length; u > n; n++) t = r.GeoJSON.latLngsToCoords(this._holes[n]), t.push(t[0]), i.push(t);
                return r.GeoJSON.getFeature(this, {
                    type: "Polygon",
                    coordinates: i
                })
            }
        }),
        function() {
            function n(n) {
                return function() {
                    var t = [];
                    return this.eachLayer(function(n) {
                        t.push(n.toGeoJSON().geometry.coordinates)
                    }), r.GeoJSON.getFeature(this, {
                        type: n,
                        coordinates: t
                    })
                }
            }
            r.MultiPolyline.include({
                toGeoJSON: n("MultiLineString")
            });
            r.MultiPolygon.include({
                toGeoJSON: n("MultiPolygon")
            });
            r.LayerGroup.include({
                toGeoJSON: function() {
                    var i, t = this.feature && this.feature.geometry,
                        u = [],
                        f;
                    return t && "MultiPoint" === t.type ? n("MultiPoint").call(this) : (f = t && "GeometryCollection" === t.type, this.eachLayer(function(n) {
                        n.toGeoJSON && (i = n.toGeoJSON(), u.push(f ? i.geometry : r.GeoJSON.asFeature(i)))
                    }), f ? r.GeoJSON.getFeature(this, {
                        geometries: u,
                        type: "GeometryCollection"
                    }) : {
                        type: "FeatureCollection",
                        features: u
                    })
                }
            })
        }();
    r.geoJson = function(n, t) {
        return new r.GeoJSON(n, t)
    };
    r.DomEvent = {
        addListener: function(n, t, i, u) {
            var f, e, s, o = r.stamp(i),
                h = "_tmap_" + t + o;
            return n[h] ? this : (f = function(t) {
                return i.call(u || n, t || r.DomEvent._getEvent())
            }, r.Browser.pointer && 0 === t.indexOf("touch") ? this.addPointerListener(n, t, f, o) : (r.Browser.touch && "dblclick" === t && this.addDoubleTapListener && this.addDoubleTapListener(n, f, o), "addEventListener" in n ? "mousewheel" === t ? (n.addEventListener("DOMMouseScroll", f, !1), n.addEventListener(t, f, !1)) : "mouseenter" === t || "mouseleave" === t ? (e = f, s = "mouseenter" === t ? "mouseover" : "mouseout", f = function(t) {
                if (r.DomEvent._checkMouse(n, t)) return e(t)
            }, n.addEventListener(s, f, !1)) : "click" === t && r.Browser.android ? (e = f, f = function(n) {
                return r.DomEvent._filterClick(n, e)
            }, n.addEventListener(t, f, !1)) : n.addEventListener(t, f, !1) : "attachEvent" in n && n.attachEvent("on" + t, f), n[h] = f, this))
        },
        removeListener: function(n, t, i) {
            var f = r.stamp(i),
                e = "_tmap_" + t + f,
                u = n[e];
            return u ? (r.Browser.pointer && 0 === t.indexOf("touch") ? this.removePointerListener(n, t, f) : r.Browser.touch && "dblclick" === t && this.removeDoubleTapListener ? this.removeDoubleTapListener(n, f) : "removeEventListener" in n ? "mousewheel" === t ? (n.removeEventListener("DOMMouseScroll", u, !1), n.removeEventListener(t, u, !1)) : "mouseenter" === t || "mouseleave" === t ? n.removeEventListener("mouseenter" === t ? "mouseover" : "mouseout", u, !1) : n.removeEventListener(t, u, !1) : "detachEvent" in n && n.detachEvent("on" + t, u), n[e] = null, this) : this
        },
        stopPropagation: function(n) {
            return n.stopPropagation ? n.stopPropagation() : n.cancelBubble = !0, r.DomEvent._skipped(n), this
        },
        disableScrollPropagation: function(n) {
            var t = r.DomEvent.stopPropagation;
            return r.DomEvent.on(n, "mousewheel", t).on(n, "MozMousePixelScroll", t)
        },
        disableClickPropagation: function(n) {
            for (var i = r.DomEvent.stopPropagation, t = r.Draggable.START.length - 1; t >= 0; t--) r.DomEvent.on(n, r.Draggable.START[t], i);
            return r.DomEvent.on(n, "click", r.DomEvent._fakeStop).on(n, "dblclick", i)
        },
        preventDefault: function(n) {
            return n.preventDefault ? n.preventDefault() : n.returnValue = !1, this
        },
        stop: function(n) {
            return r.DomEvent.preventDefault(n).stopPropagation(n)
        },
        getMousePosition: function(n, t) {
            if (!t) return new r.Point(n.clientX, n.clientY);
            var i = t.getBoundingClientRect();
            return new r.Point(n.clientX - i.left - t.clientLeft, n.clientY - i.top - t.clientTop)
        },
        getWheelDelta: function(n) {
            var t = 0;
            return n.wheelDelta && (t = n.wheelDelta / 120), n.detail && (t = -n.detail / 3), t
        },
        _skipEvents: {},
        _fakeStop: function(n) {
            r.DomEvent._skipEvents[n.type] = !0
        },
        _skipped: function(n) {
            var t = this._skipEvents[n.type];
            return this._skipEvents[n.type] = !1, t
        },
        _checkMouse: function(n, t) {
            var i = t.relatedTarget;
            if (!i) return !0;
            try {
                for (; i && i !== n;) i = i.parentNode
            } catch (r) {
                return !1
            }
            return i !== n
        },
        _getEvent: function() {
            var t = n.event,
                i;
            if (!t)
                for (i = arguments.callee.caller; i && (t = i.arguments[0], !t || n.Event !== t.constructor);) i = i.caller;
            return t
        },
        _filterClick: function(n, t) {
            var u = n.timeStamp || n.originalEvent.timeStamp,
                i = r.DomEvent._lastClick && u - r.DomEvent._lastClick;
            return i && i > 100 && 1e3 > i || n.target._simulatedClick && !n._simulated ? void r.DomEvent.stop(n) : (r.DomEvent._lastClick = u, t(n))
        }
    };
    r.DomEvent.on = r.DomEvent.addListener;
    r.DomEvent.off = r.DomEvent.removeListener;
    r.Draggable = r.Class.extend({
        includes: r.Mixin.Events,
        statics: {
            START: r.Browser.touch ? ["touchstart", "mousedown"] : ["mousedown"],
            END: {
                mousedown: "mouseup",
                touchstart: "touchend",
                pointerdown: "touchend",
                MSPointerDown: "touchend"
            },
            MOVE: {
                mousedown: "mousemove",
                touchstart: "touchmove",
                pointerdown: "touchmove",
                MSPointerDown: "touchmove"
            }
        },
        initialize: function(n, t) {
            this._element = n;
            this._dragStartTarget = t || n
        },
        enable: function() {
            if (!this._enabled) {
                for (var n = r.Draggable.START.length - 1; n >= 0; n--) r.DomEvent.on(this._dragStartTarget, r.Draggable.START[n], this._onDown, this);
                this._enabled = !0
            }
        },
        disable: function() {
            if (this._enabled) {
                for (var n = r.Draggable.START.length - 1; n >= 0; n--) r.DomEvent.off(this._dragStartTarget, r.Draggable.START[n], this._onDown, this);
                this._enabled = !1;
                this._moved = !1
            }
        },
        _onDown: function(n) {
            if (this._moved = !1, !(n.shiftKey || 1 !== n.which && 1 !== n.button && !n.touches || (r.DomEvent.stopPropagation(n), r.Draggable._disabled || (r.DomUtil.disableImageDrag(), r.DomUtil.disableTextSelection(), this._moving)))) {
                var i = n.touches ? n.touches[0] : n;
                this._startPoint = new r.Point(i.clientX, i.clientY);
                this._startPos = this._newPos = r.DomUtil.getPosition(this._element);
                r.DomEvent.on(t, r.Draggable.MOVE[n.type], this._onMove, this).on(t, r.Draggable.END[n.type], this._onUp, this)
            }
        },
        _onMove: function(n) {
            if (n.touches && n.touches.length > 1) return void(this._moved = !0);
            var u = n.touches && 1 === n.touches.length ? n.touches[0] : n,
                f = new r.Point(u.clientX, u.clientY),
                i = f.subtract(this._startPoint);
            (i.x || i.y) && (r.DomEvent.preventDefault(n), this._moved || (this.fire("dragstart"), this._moved = !0, this._startPos = r.DomUtil.getPosition(this._element).subtract(i), r.DomUtil.addClass(t.body, "tmap-dragging"), r.DomUtil.addClass(n.target || n.srcElement, "tmap-drag-target")), this._newPos = this._startPos.add(i), this._moving = !0, r.Util.cancelAnimFrame(this._animRequest), this._animRequest = r.Util.requestAnimFrame(this._updatePosition, this, !0, this._dragStartTarget))
        },
        _updatePosition: function() {
            this.fire("predrag");
            r.DomUtil.setPosition(this._element, this._newPos);
            this.fire("drag")
        },
        _onUp: function(n) {
            r.DomUtil.removeClass(t.body, "tmap-dragging");
            r.DomUtil.removeClass(n.target || n.srcElement, "tmap-drag-target");
            for (var i in r.Draggable.MOVE) r.DomEvent.off(t, r.Draggable.MOVE[i], this._onMove).off(t, r.Draggable.END[i], this._onUp);
            r.DomUtil.enableImageDrag();
            r.DomUtil.enableTextSelection();
            this._moved && this._moving && (r.Util.cancelAnimFrame(this._animRequest), this.fire("dragend", {
                distance: this._newPos.distanceTo(this._startPos)
            }));
            this._moving = !1
        }
    });
    r.Handler = r.Class.extend({
        initialize: function(n) {
            this._map = n
        },
        enable: function() {
            this._enabled || (this._enabled = !0, this.addHooks())
        },
        disable: function() {
            this._enabled && (this._enabled = !1, this.removeHooks())
        },
        enabled: function() {
            return !!this._enabled
        }
    });
    r.Map.mergeOptions({
        dragging: !0,
        inertia: !r.Browser.android23,
        inertiaDeceleration: 3400,
        inertiaMaxSpeed: 1 / 0,
        inertiaThreshold: r.Browser.touch ? 32 : 18,
        easeLinearity: .25,
        worldCopyJump: !1
    });
    r.Map.Drag = r.Handler.extend({
        addHooks: function() {
            if (!this._draggable) {
                var n = this._map;
                this._draggable = new r.Draggable(n._mapPane, n._container);
                this._draggable.on({
                    dragstart: this._onDragStart,
                    drag: this._onDrag,
                    dragend: this._onDragEnd
                }, this);
                n.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDrag, this), n.on("viewreset", this._onViewReset, this), n.whenReady(this._onViewReset, this))
            }
            this._draggable.enable()
        },
        removeHooks: function() {
            this._draggable.disable()
        },
        moved: function() {
            return this._draggable && this._draggable._moved
        },
        _onDragStart: function() {
            var n = this._map;
            n._panAnim && n._panAnim.stop();
            n.fire("movestart").fire("dragstart");
            n.options.inertia && (this._positions = [], this._times = [])
        },
        _onDrag: function() {
            if (this._map.options.inertia) {
                var n = this._lastTime = +new Date,
                    t = this._lastPos = this._draggable._newPos;
                this._positions.push(t);
                this._times.push(n);
                n - this._times[0] > 200 && (this._positions.shift(), this._times.shift())
            }
            this._map.fire("move").fire("drag")
        },
        _onViewReset: function() {
            var n = this._map.getSize()._divideBy(2),
                t = this._map.latLngToLayerPoint([0, 0]);
            this._initialWorldOffset = t.subtract(n).x;
            this._worldWidth = this._map.project([0, 180]).x
        },
        _onPreDrag: function() {
            var i = this._worldWidth,
                t = Math.round(i / 2),
                n = this._initialWorldOffset,
                r = this._draggable._newPos.x,
                u = (r - t + n) % i + t - n,
                f = (r + t + n) % i - t - n,
                e = Math.abs(u + n) < Math.abs(f + n) ? u : f;
            this._draggable._newPos.x = e
        },
        _onDragEnd: function(n) {
            var t = this._map,
                i = t.options,
                e = +new Date - this._lastTime,
                l = !i.inertia || e > i.inertiaThreshold || !this._positions[0];
            if (t.fire("dragend", n), l) t.fire("moveend");
            else {
                var a = this._lastPos.subtract(this._positions[0]),
                    v = (this._lastTime + e - this._times[0]) / 1e3,
                    f = i.easeLinearity,
                    o = a.multiplyBy(f / v),
                    s = o.distanceTo([0, 0]),
                    h = Math.min(i.inertiaMaxSpeed, s),
                    y = o.multiplyBy(h / s),
                    c = h / (i.inertiaDeceleration * f),
                    u = y.multiplyBy(-c / 2).round();
                u.x && u.y ? (u = t._limitOffset(u, t.options.maxBounds), r.Util.requestAnimFrame(function() {
                    t.panBy(u, {
                        duration: c,
                        easeLinearity: f,
                        noMoveStart: !0
                    })
                })) : t.fire("moveend")
            }
        }
    });
    r.Map.addInitHook("addHandler", "dragging", r.Map.Drag);
    r.Map.mergeOptions({
        doubleClickZoom: !0
    });
    r.Map.DoubleClickZoom = r.Handler.extend({
        addHooks: function() {
            this._map.on("dblclick", this._onDoubleClick, this)
        },
        removeHooks: function() {
            this._map.off("dblclick", this._onDoubleClick, this)
        },
        _onDoubleClick: function(n) {
            var t = this._map,
                i = t.getZoom() + (n.originalEvent.shiftKey ? -1 : 1);
            "center" === t.options.doubleClickZoom ? t.setZoom(i) : t.setZoomAround(n.containerPoint, i)
        }
    });
    r.Map.addInitHook("addHandler", "doubleClickZoom", r.Map.DoubleClickZoom);
    r.Map.mergeOptions({
        scrollWheelZoom: !0
    });
    r.Map.ScrollWheelZoom = r.Handler.extend({
        addHooks: function() {
            r.DomEvent.on(this._map._container, "mousewheel", this._onWheelScroll, this);
            r.DomEvent.on(this._map._container, "MozMousePixelScroll", r.DomEvent.preventDefault);
            this._delta = 0
        },
        removeHooks: function() {
            r.DomEvent.off(this._map._container, "mousewheel", this._onWheelScroll);
            r.DomEvent.off(this._map._container, "MozMousePixelScroll", r.DomEvent.preventDefault)
        },
        _onWheelScroll: function(n) {
            var i = r.DomEvent.getWheelDelta(n),
                t;
            this._delta += i;
            this._lastMousePos = this._map.mouseEventToContainerPoint(n);
            this._startTime || (this._startTime = +new Date);
            t = Math.max(40 - (+new Date - this._startTime), 0);
            clearTimeout(this._timer);
            this._timer = setTimeout(r.bind(this._performZoom, this), t);
            r.DomEvent.preventDefault(n);
            r.DomEvent.stopPropagation(n)
        },
        _performZoom: function() {
            var t = this._map,
                n = this._delta,
                i = t.getZoom();
            n = n > 0 ? Math.ceil(n) : Math.floor(n);
            n = Math.max(Math.min(n, 4), -4);
            n = t._limitZoom(i + n) - i;
            this._delta = 0;
            this._startTime = null;
            n && ("center" === t.options.scrollWheelZoom ? t.setZoom(i + n) : t.setZoomAround(this._lastMousePos, i + n))
        }
    });
    r.Map.addInitHook("addHandler", "scrollWheelZoom", r.Map.ScrollWheelZoom);
    r.extend(r.DomEvent, {
        _touchstart: r.Browser.msPointer ? "MSPointerDown" : r.Browser.pointer ? "pointerdown" : "touchstart",
        _touchend: r.Browser.msPointer ? "MSPointerUp" : r.Browser.pointer ? "pointerup" : "touchend",
        addDoubleTapListener: function(n, i, u) {
            function c(n) {
                var i, t, u;
                (r.Browser.pointer ? (e.push(n.pointerId), i = e.length) : i = n.touches.length, i > 1) || (t = Date.now(), u = t - (s || t), f = n.touches ? n.touches[0] : n, l = u > 0 && p >= u, s = t)
            }

            function o(n) {
                var u, t, o, h;
                if (r.Browser.pointer) {
                    if (u = e.indexOf(n.pointerId), -1 === u) return;
                    e.splice(u, 1)
                }
                if (l) {
                    if (r.Browser.pointer) {
                        o = {};
                        for (h in f) t = f[h], o[h] = "function" == typeof t ? t.bind(f) : t;
                        f = o
                    }
                    f.type = "dblclick";
                    i(f);
                    s = null
                }
            }
            var s, f, l = !1,
                p = 250,
                a = "_tmap_",
                v = this._touchstart,
                y = this._touchend,
                e = [],
                h;
            return n[a + v + u] = c, n[a + y + u] = o, h = r.Browser.pointer ? t.documentElement : n, n.addEventListener(v, c, !1), h.addEventListener(y, o, !1), r.Browser.pointer && h.addEventListener(r.DomEvent.POINTER_CANCEL, o, !1), this
        },
        removeDoubleTapListener: function(n, i) {
            var u = "_tmap_";
            return n.removeEventListener(this._touchstart, n[u + this._touchstart + i], !1), (r.Browser.pointer ? t.documentElement : n).removeEventListener(this._touchend, n[u + this._touchend + i], !1), r.Browser.pointer && t.documentElement.removeEventListener(r.DomEvent.POINTER_CANCEL, n[u + this._touchend + i], !1), this
        }
    });
    r.extend(r.DomEvent, {
        POINTER_DOWN: r.Browser.msPointer ? "MSPointerDown" : "pointerdown",
        POINTER_MOVE: r.Browser.msPointer ? "MSPointerMove" : "pointermove",
        POINTER_UP: r.Browser.msPointer ? "MSPointerUp" : "pointerup",
        POINTER_CANCEL: r.Browser.msPointer ? "MSPointerCancel" : "pointercancel",
        _pointers: [],
        _pointerDocumentListener: !1,
        addPointerListener: function(n, t, i, r) {
            switch (t) {
                case "touchstart":
                    return this.addPointerListenerStart(n, t, i, r);
                case "touchend":
                    return this.addPointerListenerEnd(n, t, i, r);
                case "touchmove":
                    return this.addPointerListenerMove(n, t, i, r);
                default:
                    throw "Unknown touch event type";
            }
        },
        addPointerListenerStart: function(n, i, u, f) {
            var e = this._pointers,
                s = function(n) {
                    r.DomEvent.preventDefault(n);
                    for (var i = !1, t = 0; t < e.length; t++)
                        if (e[t].pointerId === n.pointerId) {
                            i = !0;
                            break
                        }
                    i || e.push(n);
                    n.touches = e.slice();
                    n.changedTouches = [n];
                    u(n)
                },
                o;
            return (n["_tmap_touchstart" + f] = s, n.addEventListener(this.POINTER_DOWN, s, !1), this._pointerDocumentListener) || (o = function(n) {
                for (var t = 0; t < e.length; t++)
                    if (e[t].pointerId === n.pointerId) {
                        e.splice(t, 1);
                        break
                    }
            }, t.documentElement.addEventListener(this.POINTER_UP, o, !1), t.documentElement.addEventListener(this.POINTER_CANCEL, o, !1), this._pointerDocumentListener = !0), this
        },
        addPointerListenerMove: function(n, t, i, r) {
            function f(n) {
                if (n.pointerType !== n.MSPOINTER_TYPE_MOUSE && "mouse" !== n.pointerType || 0 !== n.buttons) {
                    for (var t = 0; t < u.length; t++)
                        if (u[t].pointerId === n.pointerId) {
                            u[t] = n;
                            break
                        }
                    n.touches = u.slice();
                    n.changedTouches = [n];
                    i(n)
                }
            }
            var u = this._pointers;
            return n["_tmap_touchmove" + r] = f, n.addEventListener(this.POINTER_MOVE, f, !1), this
        },
        addPointerListenerEnd: function(n, t, i, r) {
            var u = this._pointers,
                f = function(n) {
                    for (var t = 0; t < u.length; t++)
                        if (u[t].pointerId === n.pointerId) {
                            u.splice(t, 1);
                            break
                        }
                    n.touches = u.slice();
                    n.changedTouches = [n];
                    i(n)
                };
            return n["_tmap_touchend" + r] = f, n.addEventListener(this.POINTER_UP, f, !1), n.addEventListener(this.POINTER_CANCEL, f, !1), this
        },
        removePointerListener: function(n, t, i) {
            var r = n["_tmap_" + t + i];
            switch (t) {
                case "touchstart":
                    n.removeEventListener(this.POINTER_DOWN, r, !1);
                    break;
                case "touchmove":
                    n.removeEventListener(this.POINTER_MOVE, r, !1);
                    break;
                case "touchend":
                    n.removeEventListener(this.POINTER_UP, r, !1);
                    n.removeEventListener(this.POINTER_CANCEL, r, !1)
            }
            return this
        }
    });
    r.Map.mergeOptions({
        touchZoom: r.Browser.touch && !r.Browser.android23,
        bounceAtZoomLimits: !0
    });
    r.Map.TouchZoom = r.Handler.extend({
        addHooks: function() {
            r.DomEvent.on(this._map._container, "touchstart", this._onTouchStart, this)
        },
        removeHooks: function() {
            r.DomEvent.off(this._map._container, "touchstart", this._onTouchStart, this)
        },
        _onTouchStart: function(n) {
            var i = this._map;
            if (n.touches && 2 === n.touches.length && !i._animatingZoom && !this._zooming) {
                var u = i.mouseEventToLayerPoint(n.touches[0]),
                    f = i.mouseEventToLayerPoint(n.touches[1]),
                    e = i._getCenterLayerPoint();
                this._startCenter = u.add(f)._divideBy(2);
                this._startDist = u.distanceTo(f);
                this._moved = !1;
                this._zooming = !0;
                this._centerOffset = e.subtract(this._startCenter);
                i._panAnim && i._panAnim.stop();
                r.DomEvent.on(t, "touchmove", this._onTouchMove, this).on(t, "touchend", this._onTouchEnd, this);
                r.DomEvent.preventDefault(n)
            }
        },
        _onTouchMove: function(n) {
            var t = this._map,
                i, u;
            n.touches && 2 === n.touches.length && this._zooming && (i = t.mouseEventToLayerPoint(n.touches[0]), u = t.mouseEventToLayerPoint(n.touches[1]), this._scale = i.distanceTo(u) / this._startDist, this._delta = i._add(u)._divideBy(2)._subtract(this._startCenter), 1 !== this._scale && (t.options.bounceAtZoomLimits || !(t.getZoom() === t.getMinZoom() && this._scale < 1 || t.getZoom() === t.getMaxZoom() && this._scale > 1)) && (this._moved || (r.DomUtil.addClass(t._mapPane, "tmap-touching"), t.fire("movestart").fire("zoomstart"), this._moved = !0), r.Util.cancelAnimFrame(this._animRequest), this._animRequest = r.Util.requestAnimFrame(this._updateOnMove, this, !0, this._map._container), r.DomEvent.preventDefault(n)))
        },
        _updateOnMove: function() {
            var n = this._map,
                t = this._getScaleOrigin(),
                i = n.layerPointToLatLng(t),
                r = n.getScaleZoom(this._scale);
            n._animateZoom(i, r, this._startCenter, this._scale, this._delta)
        },
        _onTouchEnd: function() {
            var n;
            if (!this._moved || !this._zooming) return void(this._zooming = !1);
            n = this._map;
            this._zooming = !1;
            r.DomUtil.removeClass(n._mapPane, "tmap-touching");
            r.Util.cancelAnimFrame(this._animRequest);
            r.DomEvent.off(t, "touchmove", this._onTouchMove).off(t, "touchend", this._onTouchEnd);
            var u = this._getScaleOrigin(),
                o = n.layerPointToLatLng(u),
                f = n.getZoom(),
                i = n.getScaleZoom(this._scale) - f,
                s = i > 0 ? Math.ceil(i) : Math.floor(i),
                e = n._limitZoom(f + s),
                h = n.getZoomScale(e) / this._scale;
            n._animateZoom(o, e, u, h)
        },
        _getScaleOrigin: function() {
            var n = this._centerOffset.subtract(this._delta).divideBy(this._scale);
            return this._startCenter.add(n)
        }
    });
    r.Map.addInitHook("addHandler", "touchZoom", r.Map.TouchZoom);
    r.Map.mergeOptions({
        tap: !0,
        tapTolerance: 15
    });
    r.Map.Tap = r.Handler.extend({
        addHooks: function() {
            r.DomEvent.on(this._map._container, "touchstart", this._onDown, this)
        },
        removeHooks: function() {
            r.DomEvent.off(this._map._container, "touchstart", this._onDown, this)
        },
        _onDown: function(n) {
            if (n.touches) {
                if (r.DomEvent.preventDefault(n), this._fireClick = !0, n.touches.length > 1) return this._fireClick = !1, void clearTimeout(this._holdTimeout);
                var i = n.touches[0],
                    u = i.target;
                this._startPos = this._newPos = new r.Point(i.clientX, i.clientY);
                u.tagName && "a" === u.tagName.toLowerCase() && r.DomUtil.addClass(u, "tmap-active");
                this._holdTimeout = setTimeout(r.bind(function() {
                    this._isTapValid() && (this._fireClick = !1, this._onUp(), this._simulateEvent("contextmenu", i))
                }, this), 1e3);
                r.DomEvent.on(t, "touchmove", this._onMove, this).on(t, "touchend", this._onUp, this)
            }
        },
        _onUp: function(n) {
            if (clearTimeout(this._holdTimeout), r.DomEvent.off(t, "touchmove", this._onMove, this).off(t, "touchend", this._onUp, this), this._fireClick && n && n.changedTouches) {
                var u = n.changedTouches[0],
                    i = u.target;
                i && i.tagName && "a" === i.tagName.toLowerCase() && r.DomUtil.removeClass(i, "tmap-active");
                this._isTapValid() && this._simulateEvent("click", u)
            }
        },
        _isTapValid: function() {
            return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance
        },
        _onMove: function(n) {
            var t = n.touches[0];
            this._newPos = new r.Point(t.clientX, t.clientY)
        },
        _simulateEvent: function(i, r) {
            var u = t.createEvent("MouseEvents");
            u._simulated = !0;
            r.target._simulatedClick = !0;
            u.initMouseEvent(i, !0, !0, n, 1, r.screenX, r.screenY, r.clientX, r.clientY, !1, !1, !1, !1, 0, null);
            r.target.dispatchEvent(u)
        }
    });
    r.Browser.touch && !r.Browser.pointer && r.Map.addInitHook("addHandler", "tap", r.Map.Tap);
    r.Map.mergeOptions({
        boxZoom: !0
    });
    r.Map.BoxZoom = r.Handler.extend({
        initialize: function(n) {
            this._map = n;
            this._container = n._container;
            this._pane = n._panes.overlayPane;
            this._moved = !1
        },
        addHooks: function() {
            r.DomEvent.on(this._container, "mousedown", this._onMouseDown, this)
        },
        removeHooks: function() {
            r.DomEvent.off(this._container, "mousedown", this._onMouseDown);
            this._moved = !1
        },
        moved: function() {
            return this._moved
        },
        _onMouseDown: function(n) {
            return this._moved = !1, !n.shiftKey || 1 !== n.which && 1 !== n.button ? !1 : (r.DomUtil.disableTextSelection(), r.DomUtil.disableImageDrag(), this._startLayerPoint = this._map.mouseEventToLayerPoint(n), void r.DomEvent.on(t, "mousemove", this._onMouseMove, this).on(t, "mouseup", this._onMouseUp, this).on(t, "keydown", this._onKeyDown, this))
        },
        _onMouseMove: function(n) {
            this._moved || (this._box = r.DomUtil.create("div", "tmap-zoom-box", this._pane), r.DomUtil.setPosition(this._box, this._startLayerPoint), this._container.style.cursor = "crosshair", this._map.fire("boxzoomstart"));
            var t = this._startLayerPoint,
                i = this._box,
                u = this._map.mouseEventToLayerPoint(n),
                f = u.subtract(t),
                e = new r.Point(Math.min(u.x, t.x), Math.min(u.y, t.y));
            r.DomUtil.setPosition(i, e);
            this._moved = !0;
            i.style.width = Math.max(0, Math.abs(f.x) - 4) + "px";
            i.style.height = Math.max(0, Math.abs(f.y) - 4) + "px"
        },
        _finish: function() {
            this._moved && (this._pane.removeChild(this._box), this._container.style.cursor = "");
            r.DomUtil.enableTextSelection();
            r.DomUtil.enableImageDrag();
            r.DomEvent.off(t, "mousemove", this._onMouseMove).off(t, "mouseup", this._onMouseUp).off(t, "keydown", this._onKeyDown)
        },
        _onMouseUp: function(n) {
            var t, i, u;
            this._finish();
            t = this._map;
            i = t.mouseEventToLayerPoint(n);
            this._startLayerPoint.equals(i) || (u = new r.LatLngBounds(t.layerPointToLatLng(this._startLayerPoint), t.layerPointToLatLng(i)), t.fitBounds(u), t.fire("boxzoomend", {
                boxZoomBounds: u
            }))
        },
        _onKeyDown: function(n) {
            27 === n.keyCode && this._finish()
        }
    });
    r.Map.addInitHook("addHandler", "boxZoom", r.Map.BoxZoom);
    r.Map.mergeOptions({
        keyboard: !0,
        keyboardPanOffset: 80,
        keyboardZoomOffset: 1
    });
    r.Map.Keyboard = r.Handler.extend({
        keyCodes: {
            left: [37],
            right: [39],
            down: [40],
            up: [38],
            zoomIn: [187, 107, 61, 171],
            zoomOut: [189, 109, 173]
        },
        initialize: function(n) {
            this._map = n;
            this._setPanOffset(n.options.keyboardPanOffset);
            this._setZoomOffset(n.options.keyboardZoomOffset)
        },
        addHooks: function() {
            var n = this._map._container; - 1 === n.tabIndex && (n.tabIndex = "0");
            r.DomEvent.on(n, "focus", this._onFocus, this).on(n, "blur", this._onBlur, this).on(n, "mousedown", this._onMouseDown, this);
            this._map.on("focus", this._addHooks, this).on("blur", this._removeHooks, this)
        },
        removeHooks: function() {
            this._removeHooks();
            var n = this._map._container;
            r.DomEvent.off(n, "focus", this._onFocus, this).off(n, "blur", this._onBlur, this).off(n, "mousedown", this._onMouseDown, this);
            this._map.off("focus", this._addHooks, this).off("blur", this._removeHooks, this)
        },
        _onMouseDown: function() {
            if (!this._focused) {
                var i = t.body,
                    r = t.documentElement,
                    u = i.scrollTop || r.scrollTop,
                    f = i.scrollLeft || r.scrollLeft;
                this._map._container.focus();
                n.scrollTo(f, u)
            }
        },
        _onFocus: function() {
            this._focused = !0;
            this._map.fire("focus")
        },
        _onBlur: function() {
            this._focused = !1;
            this._map.fire("blur")
        },
        _setPanOffset: function(n) {
            for (var u = this._panKeys = {}, r = this.keyCodes, t = 0, i = r.left.length; i > t; t++) u[r.left[t]] = [-1 * n, 0];
            for (t = 0, i = r.right.length; i > t; t++) u[r.right[t]] = [n, 0];
            for (t = 0, i = r.down.length; i > t; t++) u[r.down[t]] = [0, n];
            for (t = 0, i = r.up.length; i > t; t++) u[r.up[t]] = [0, -1 * n]
        },
        _setZoomOffset: function(n) {
            for (var u = this._zoomKeys = {}, r = this.keyCodes, t = 0, i = r.zoomIn.length; i > t; t++) u[r.zoomIn[t]] = n;
            for (t = 0, i = r.zoomOut.length; i > t; t++) u[r.zoomOut[t]] = -n
        },
        _addHooks: function() {
            r.DomEvent.on(t, "keydown", this._onKeyDown, this)
        },
        _removeHooks: function() {
            r.DomEvent.off(t, "keydown", this._onKeyDown, this)
        },
        _onKeyDown: function(n) {
            var i = n.keyCode,
                t = this._map;
            if (i in this._panKeys) {
                if (t._panAnim && t._panAnim._inProgress) return;
                t.panBy(this._panKeys[i]);
                t.options.maxBounds && t.panInsideBounds(t.options.maxBounds)
            } else {
                if (!(i in this._zoomKeys)) return;
                t.setZoom(t.getZoom() + this._zoomKeys[i])
            }
            r.DomEvent.stop(n)
        }
    });
    r.Map.addInitHook("addHandler", "keyboard", r.Map.Keyboard);
    r.Handler.MarkerDrag = r.Handler.extend({
        initialize: function(n) {
            this._marker = n
        },
        addHooks: function() {
            var n = this._marker._icon;
            this._draggable || (this._draggable = new r.Draggable(n, n));
            this._draggable.on("dragstart", this._onDragStart, this).on("drag", this._onDrag, this).on("dragend", this._onDragEnd, this);
            this._draggable.enable();
            r.DomUtil.addClass(this._marker._icon, "tmap-marker-draggable")
        },
        removeHooks: function() {
            this._draggable.off("dragstart", this._onDragStart, this).off("drag", this._onDrag, this).off("dragend", this._onDragEnd, this);
            this._draggable.disable();
            r.DomUtil.removeClass(this._marker._icon, "tmap-marker-draggable")
        },
        moved: function() {
            return this._draggable && this._draggable._moved
        },
        _onDragStart: function() {
            this._marker.closePopup().fire("movestart").fire("dragstart")
        },
        _onDrag: function() {
            var n = this._marker,
                t = n._shadow,
                i = r.DomUtil.getPosition(n._icon),
                u = n._map.layerPointToLatLng(i);
            t && r.DomUtil.setPosition(t, i);
            n._latlng = u;
            n.fire("move", {
                latlng: u
            }).fire("drag")
        },
        _onDragEnd: function(n) {
            this._marker.fire("moveend").fire("dragend", n)
        }
    });
    r.Control = r.Class.extend({
        options: {
            position: "topright"
        },
        initialize: function(n) {
            r.setOptions(this, n)
        },
        getPosition: function() {
            return this.options.position
        },
        setPosition: function(n) {
            var t = this._map;
            return t && t.removeControl(this), this.options.position = n, t && t.addControl(this), this
        },
        getContainer: function() {
            return this._container
        },
        addTo: function(n) {
            this._map = n;
            var t = this._container = this.onAdd(n),
                u = this.getPosition(),
                i = n._controlCorners[u];
            return r.DomUtil.addClass(t, "tmap-control"), -1 !== u.indexOf("bottom") ? i.insertBefore(t, i.firstChild) : i.appendChild(t), this
        },
        removeFrom: function(n) {
            var t = this.getPosition(),
                i = n._controlCorners[t];
            return i.removeChild(this._container), this._map = null, this.onRemove && this.onRemove(n), this
        },
        _refocusOnMap: function() {
            this._map && this._map.getContainer().focus()
        }
    });
    r.control = function(n) {
        return new r.Control(n)
    };
    r.Map.include({
        addControl: function(n) {
            return n.addTo(this), this
        },
        removeControl: function(n) {
            return n.removeFrom(this), this
        },
        _initControlPos: function() {
            function n(n, f) {
                var e = t + n + " " + t + f;
                i[n + f] = r.DomUtil.create("div", e, u)
            }
            var i = this._controlCorners = {},
                t = "tmap-",
                u = this._controlContainer = r.DomUtil.create("div", t + "control-container", this._container);
            n("top", "left");
            n("top", "right");
            n("bottom", "left");
            n("bottom", "right")
        },
        _clearControlPos: function() {
            this._container.removeChild(this._controlContainer)
        }
    });
    r.Control.Zoom = r.Control.extend({
        options: {
            position: "topleft",
            zoomInText: "+",
            zoomInTitle: "Zoom in",
            zoomOutText: "-",
            zoomOutTitle: "Zoom out"
        },
        onAdd: function(n) {
            var t = "tmap-control-zoom",
                i = r.DomUtil.create("div", t + " tmap-bar");
            return this._map = n, this._zoomInButton = this._createButton(this.options.zoomInText, this.options.zoomInTitle, t + "-in", i, this._zoomIn, this), this._zoomOutButton = this._createButton(this.options.zoomOutText, this.options.zoomOutTitle, t + "-out", i, this._zoomOut, this), this._updateDisabled(), n.on("zoomend zoomlevelschange", this._updateDisabled, this), i
        },
        onRemove: function(n) {
            n.off("zoomend zoomlevelschange", this._updateDisabled, this)
        },
        _zoomIn: function(n) {
            this._map.zoomIn(n.shiftKey ? 3 : 1)
        },
        _zoomOut: function(n) {
            this._map.zoomOut(n.shiftKey ? 3 : 1)
        },
        _createButton: function(n, t, i, u, f, e) {
            var o = r.DomUtil.create("a", i, u),
                s;
            return o.innerHTML = n, o.href = "#", o.title = t, s = r.DomEvent.stopPropagation, r.DomEvent.on(o, "click", s).on(o, "mousedown", s).on(o, "dblclick", s).on(o, "click", r.DomEvent.preventDefault).on(o, "click", f, e).on(o, "click", this._refocusOnMap, e), o
        },
        _updateDisabled: function() {
            var n = this._map,
                t = "tmap-disabled";
            r.DomUtil.removeClass(this._zoomInButton, t);
            r.DomUtil.removeClass(this._zoomOutButton, t);
            n._zoom === n.getMinZoom() && r.DomUtil.addClass(this._zoomOutButton, t);
            n._zoom === n.getMaxZoom() && r.DomUtil.addClass(this._zoomInButton, t)
        }
    });
    r.Map.mergeOptions({
        zoomControl: !0
    });
    r.Map.addInitHook(function() {
        this.options.zoomControl && (this.zoomControl = new r.Control.Zoom, this.addControl(this.zoomControl))
    });
    r.control.zoom = function(n) {
        return new r.Control.Zoom(n)
    };
    r.Control.Attribution = r.Control.extend({
        options: {
            position: "bottomright",
            prefix: '<a href="http://tmapjs.com" title="A JS library for interactive maps">Leaflet<\/a>'
        },
        initialize: function(n) {
            r.setOptions(this, n);
            this._attributions = {}
        },
        onAdd: function(n) {
            this._container = r.DomUtil.create("div", "tmap-control-attribution");
            r.DomEvent.disableClickPropagation(this._container);
            for (var t in n._layers) n._layers[t].getAttribution && this.addAttribution(n._layers[t].getAttribution());
            return n.on("layeradd", this._onLayerAdd, this).on("layerremove", this._onLayerRemove, this), this._update(), this._container
        },
        onRemove: function(n) {
            n.off("layeradd", this._onLayerAdd).off("layerremove", this._onLayerRemove)
        },
        setPrefix: function(n) {
            return this.options.prefix = n, this._update(), this
        },
        addAttribution: function(n) {
            if (n) return (this._attributions[n] || (this._attributions[n] = 0), this._attributions[n]++, this._update(), this)
        },
        removeAttribution: function(n) {
            if (n) return (this._attributions[n] && (this._attributions[n]--, this._update()), this)
        },
        _update: function() {
            var n, i, t;
            if (this._map) {
                n = [];
                for (i in this._attributions) this._attributions[i] && n.push(i);
                t = [];
                this.options.prefix && t.push(this.options.prefix);
                n.length && t.push(n.join(", "));
                this._container.innerHTML = t.join(" | ")
            }
        },
        _onLayerAdd: function(n) {
            n.layer.getAttribution && this.addAttribution(n.layer.getAttribution())
        },
        _onLayerRemove: function(n) {
            n.layer.getAttribution && this.removeAttribution(n.layer.getAttribution())
        }
    });
    r.Map.mergeOptions({
        attributionControl: !0
    });
    r.Map.addInitHook(function() {
        this.options.attributionControl && (this.attributionControl = (new r.Control.Attribution).addTo(this))
    });
    r.control.attribution = function(n) {
        return new r.Control.Attribution(n)
    };
    r.Control.Scale = r.Control.extend({
        options: {
            position: "bottomleft",
            maxWidth: 100,
            metric: !0,
            imperial: !0,
            updateWhenIdle: !1
        },
        onAdd: function(n) {
            this._map = n;
            var t = "tmap-control-scale",
                i = r.DomUtil.create("div", t),
                u = this.options;
            return this._addScales(u, t, i), n.on(u.updateWhenIdle ? "moveend" : "move", this._update, this), n.whenReady(this._update, this), i
        },
        onRemove: function(n) {
            n.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this)
        },
        _addScales: function(n, t, i) {
            n.metric && (this._mScale = r.DomUtil.create("div", t + "-line", i));
            n.imperial && (this._iScale = r.DomUtil.create("div", t + "-line", i))
        },
        _update: function() {
            var n = this._map.getBounds(),
                u = n.getCenter().lat,
                f = 6378137 * Math.PI * Math.cos(u * Math.PI / 180),
                e = f * (n.getNorthEast().lng - n.getSouthWest().lng) / 180,
                t = this._map.getSize(),
                i = this.options,
                r = 0;
            t.x > 0 && (r = e * (i.maxWidth / t.x));
            this._updateScales(i, r)
        },
        _updateScales: function(n, t) {
            n.metric && t && this._updateMetric(t);
            n.imperial && t && this._updateImperial(t)
        },
        _updateMetric: function(n) {
            var t = this._getRoundNum(n);
            this._mScale.style.width = this._getScaleWidth(t / n) + "px";
            this._mScale.innerHTML = 1e3 > t ? t + " m" : t / 1e3 + " km"
        },
        _updateImperial: function(n) {
            var r, u, f, t = 3.2808399 * n,
                i = this._iScale;
            t > 5280 ? (r = t / 5280, u = this._getRoundNum(r), i.style.width = this._getScaleWidth(u / r) + "px", i.innerHTML = u + " mi") : (f = this._getRoundNum(t), i.style.width = this._getScaleWidth(f / t) + "px", i.innerHTML = f + " ft")
        },
        _getScaleWidth: function(n) {
            return Math.round(this.options.maxWidth * n) - 10
        },
        _getRoundNum: function(n) {
            var i = Math.pow(10, (Math.floor(n) + "").length - 1),
                t = n / i;
            return t = t >= 10 ? 10 : t >= 5 ? 5 : t >= 3 ? 3 : t >= 2 ? 2 : 1, i * t
        }
    });
    r.control.scale = function(n) {
        return new r.Control.Scale(n)
    };
    r.Control.Layers = r.Control.extend({
        options: {
            collapsed: !0,
            position: "topright",
            autoZIndex: !0
        },
        initialize: function(n, t, i) {
            r.setOptions(this, i);
            this._layers = {};
            this._lastZIndex = 0;
            this._handlingClick = !1;
            for (var u in n) this._addLayer(n[u], u);
            for (u in t) this._addLayer(t[u], u, !0)
        },
        onAdd: function(n) {
            return this._initLayout(), this._update(), n.on("layeradd", this._onLayerChange, this).on("layerremove", this._onLayerChange, this), this._container
        },
        onRemove: function(n) {
            n.off("layeradd", this._onLayerChange).off("layerremove", this._onLayerChange)
        },
        addBaseLayer: function(n, t) {
            return this._addLayer(n, t), this._update(), this
        },
        addOverlay: function(n, t) {
            return this._addLayer(n, t, !0), this._update(), this
        },
        removeLayer: function(n) {
            var t = r.stamp(n);
            return delete this._layers[t], this._update(), this
        },
        _initLayout: function() {
            var t = "tmap-control-layers",
                n = this._container = r.DomUtil.create("div", t),
                i, u;
            n.setAttribute("aria-haspopup", !0);
            r.Browser.touch ? r.DomEvent.on(n, "click", r.DomEvent.stopPropagation) : r.DomEvent.disableClickPropagation(n).disableScrollPropagation(n);
            i = this._form = r.DomUtil.create("form", t + "-list");
            this.options.collapsed ? (r.Browser.android || r.DomEvent.on(n, "mouseover", this._expand, this).on(n, "mouseout", this._collapse, this), u = this._layersLink = r.DomUtil.create("a", t + "-toggle", n), u.href = "#", u.title = "Layers", r.Browser.touch ? r.DomEvent.on(u, "click", r.DomEvent.stop).on(u, "click", this._expand, this) : r.DomEvent.on(u, "focus", this._expand, this), r.DomEvent.on(i, "click", function() {
                setTimeout(r.bind(this._onInputClick, this), 0)
            }, this), this._map.on("click", this._collapse, this)) : this._expand();
            this._baseLayersList = r.DomUtil.create("div", t + "-base", i);
            this._separator = r.DomUtil.create("div", t + "-separator", i);
            this._overlaysList = r.DomUtil.create("div", t + "-overlays", i);
            n.appendChild(i)
        },
        _addLayer: function(n, t, i) {
            var u = r.stamp(n);
            this._layers[u] = {
                layer: n,
                name: t,
                overlay: i
            };
            this.options.autoZIndex && n.setZIndex && (this._lastZIndex++, n.setZIndex(this._lastZIndex))
        },
        _update: function() {
            if (this._container) {
                this._baseLayersList.innerHTML = "";
                this._overlaysList.innerHTML = "";
                var r, n, t = !1,
                    i = !1;
                for (r in this._layers) n = this._layers[r], this._addItem(n), i = i || n.overlay, t = t || !n.overlay;
                this._separator.style.display = i && t ? "" : "none"
            }
        },
        _onLayerChange: function(n) {
            var t = this._layers[r.stamp(n.layer)],
                i;
            t && (this._handlingClick || this._update(), i = t.overlay ? "layeradd" === n.type ? "overlayadd" : "overlayremove" : "layeradd" === n.type ? "baselayerchange" : null, i && this._map.fire(i, t))
        },
        _createRadioElement: function(n, i) {
            var r = '<input type="radio" class="tmap-control-layers-selector" name="' + n + '"',
                u;
            return i && (r += ' checked="checked"'), r += "/>", u = t.createElement("div"), u.innerHTML = r, u.firstChild
        },
        _addItem: function(n) {
            var i, u = t.createElement("label"),
                e = this._map.hasLayer(n.layer),
                f, o;
            return n.overlay ? (i = t.createElement("input"), i.type = "checkbox", i.className = "tmap-control-layers-selector", i.defaultChecked = e) : i = this._createRadioElement("tmap-base-layers", e), i.layerId = r.stamp(n.layer), r.DomEvent.on(i, "click", this._onInputClick, this), f = t.createElement("span"), f.innerHTML = " " + n.name, u.appendChild(i), u.appendChild(f), o = n.overlay ? this._overlaysList : this._baseLayersList, o.appendChild(u), u
        },
        _onInputClick: function() {
            var t, i, n, r = this._form.getElementsByTagName("input"),
                u = r.length;
            for (this._handlingClick = !0, t = 0; u > t; t++) i = r[t], n = this._layers[i.layerId], i.checked && !this._map.hasLayer(n.layer) ? this._map.addLayer(n.layer) : !i.checked && this._map.hasLayer(n.layer) && this._map.removeLayer(n.layer);
            this._handlingClick = !1;
            this._refocusOnMap()
        },
        _expand: function() {
            r.DomUtil.addClass(this._container, "tmap-control-layers-expanded")
        },
        _collapse: function() {
            this._container.className = this._container.className.replace(" tmap-control-layers-expanded", "")
        }
    });
    r.control.layers = function(n, t, i) {
        return new r.Control.Layers(n, t, i)
    };
    r.PosAnimation = r.Class.extend({
        includes: r.Mixin.Events,
        run: function(n, t, i, u) {
            this.stop();
            this._el = n;
            this._inProgress = !0;
            this._newPos = t;
            this.fire("start");
            n.style[r.DomUtil.TRANSITION] = "all " + (i || .25) + "s cubic-bezier(0,0," + (u || .5) + ",1)";
            r.DomEvent.on(n, r.DomUtil.TRANSITION_END, this._onTransitionEnd, this);
            r.DomUtil.setPosition(n, t);
            r.Util.falseFn(n.offsetWidth);
            this._stepTimer = setInterval(r.bind(this._onStep, this), 50)
        },
        stop: function() {
            this._inProgress && (r.DomUtil.setPosition(this._el, this._getPos()), this._onTransitionEnd(), r.Util.falseFn(this._el.offsetWidth))
        },
        _onStep: function() {
            var n = this._getPos();
            return n ? (this._el._tmap_pos = n, void this.fire("step")) : void this._onTransitionEnd()
        },
        _transformRe: /([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,
        _getPos: function() {
            var i, u, t, e = this._el,
                f = n.getComputedStyle(e);
            if (r.Browser.any3d) {
                if (t = f[r.DomUtil.TRANSFORM].match(this._transformRe), !t) return;
                i = parseFloat(t[1]);
                u = parseFloat(t[2])
            } else i = parseFloat(f.left), u = parseFloat(f.top);
            return new r.Point(i, u, !0)
        },
        _onTransitionEnd: function() {
            r.DomEvent.off(this._el, r.DomUtil.TRANSITION_END, this._onTransitionEnd, this);
            this._inProgress && (this._inProgress = !1, this._el.style[r.DomUtil.TRANSITION] = "", this._el._tmap_pos = this._newPos, clearInterval(this._stepTimer), this.fire("step").fire("end"))
        }
    });
    r.Map.include({
        setView: function(n, t, u) {
            if (t = t === i ? this._zoom : this._limitZoom(t), n = this._limitCenter(r.latLng(n), t, this.options.maxBounds), u = u || {}, this._panAnim && this._panAnim.stop(), this._loaded && !u.reset && u !== !0) {
                u.animate !== i && (u.zoom = r.extend({
                    animate: u.animate
                }, u.zoom), u.pan = r.extend({
                    animate: u.animate
                }, u.pan));
                var f = this._zoom !== t ? this._tryAnimatedZoom && this._tryAnimatedZoom(n, t, u.zoom) : this._tryAnimatedPan(n, u.pan);
                if (f) return clearTimeout(this._sizeTimer), this
            }
            return this._resetView(n, t), this
        },
        panBy: function(n, t) {
            if (n = r.point(n).round(), t = t || {}, !n.x && !n.y) return this;
            if (this._panAnim || (this._panAnim = new r.PosAnimation, this._panAnim.on({
                    step: this._onPanTransitionStep,
                    end: this._onPanTransitionEnd
                }, this)), t.noMoveStart || this.fire("movestart"), t.animate !== !1) {
                r.DomUtil.addClass(this._mapPane, "tmap-pan-anim");
                var i = this._getMapPanePos().subtract(n);
                this._panAnim.run(this._mapPane, i, t.duration || .25, t.easeLinearity)
            } else this._rawPanBy(n), this.fire("move").fire("moveend");
            return this
        },
        _onPanTransitionStep: function() {
            this.fire("move")
        },
        _onPanTransitionEnd: function() {
            r.DomUtil.removeClass(this._mapPane, "tmap-pan-anim");
            this.fire("moveend")
        },
        _tryAnimatedPan: function(n, t) {
            var i = this._getCenterOffset(n)._floor();
            return (t && t.animate) === !0 || this.getSize().contains(i) ? (this.panBy(i, t), !0) : !1
        }
    });
    r.PosAnimation = r.DomUtil.TRANSITION ? r.PosAnimation : r.PosAnimation.extend({
        run: function(n, t, i, u) {
            this.stop();
            this._el = n;
            this._inProgress = !0;
            this._duration = i || .25;
            this._easeOutPower = 1 / Math.max(u || .5, .2);
            this._startPos = r.DomUtil.getPosition(n);
            this._offset = t.subtract(this._startPos);
            this._startTime = +new Date;
            this.fire("start");
            this._animate()
        },
        stop: function() {
            this._inProgress && (this._step(), this._complete())
        },
        _animate: function() {
            this._animId = r.Util.requestAnimFrame(this._animate, this);
            this._step()
        },
        _step: function() {
            var n = +new Date - this._startTime,
                t = 1e3 * this._duration;
            t > n ? this._runFrame(this._easeOut(n / t)) : (this._runFrame(1), this._complete())
        },
        _runFrame: function(n) {
            var t = this._startPos.add(this._offset.multiplyBy(n));
            r.DomUtil.setPosition(this._el, t);
            this.fire("step")
        },
        _complete: function() {
            r.Util.cancelAnimFrame(this._animId);
            this._inProgress = !1;
            this.fire("end")
        },
        _easeOut: function(n) {
            return 1 - Math.pow(1 - n, this._easeOutPower)
        }
    });
    r.Map.mergeOptions({
        zoomAnimation: !0,
        zoomAnimationThreshold: 4
    });
    r.DomUtil.TRANSITION && r.Map.addInitHook(function() {
        this._zoomAnimated = this.options.zoomAnimation && r.DomUtil.TRANSITION && r.Browser.any3d && !r.Browser.android23 && !r.Browser.mobileOpera;
        this._zoomAnimated && r.DomEvent.on(this._mapPane, r.DomUtil.TRANSITION_END, this._catchTransitionEnd, this)
    });
    r.Map.include(r.DomUtil.TRANSITION ? {
        _catchTransitionEnd: function(n) {
            this._animatingZoom && n.propertyName.indexOf("transform") >= 0 && this._onZoomTransitionEnd()
        },
        _nothingToAnimate: function() {
            return !this._container.getElementsByClassName("tmap-zoom-animated").length
        },
        _tryAnimatedZoom: function(n, t, i) {
            if (this._animatingZoom) return !0;
            if (i = i || {}, !this._zoomAnimated || i.animate === !1 || this._nothingToAnimate() || Math.abs(t - this._zoom) > this.options.zoomAnimationThreshold) return !1;
            var r = this.getZoomScale(t),
                u = this._getCenterOffset(n)._divideBy(1 - 1 / r),
                f = this._getCenterLayerPoint()._add(u);
            return i.animate === !0 || this.getSize().contains(u) ? (this.fire("movestart").fire("zoomstart"), this._animateZoom(n, t, f, r, null, !0), !0) : !1
        },
        _animateZoom: function(n, t, i, u, f, e) {
            this._animatingZoom = !0;
            r.DomUtil.addClass(this._mapPane, "tmap-zoom-anim");
            this._animateToCenter = n;
            this._animateToZoom = t;
            r.Draggable && (r.Draggable._disabled = !0);
            this.fire("zoomanim", {
                center: n,
                zoom: t,
                origin: i,
                scale: u,
                delta: f,
                backwards: e
            })
        },
        _onZoomTransitionEnd: function() {
            this._animatingZoom = !1;
            r.DomUtil.removeClass(this._mapPane, "tmap-zoom-anim");
            this._resetView(this._animateToCenter, this._animateToZoom, !0, !0);
            r.Draggable && (r.Draggable._disabled = !1)
        }
    } : {});
    r.TileLayer.include({
        _animateZoom: function(n) {
            this._animating || (this._animating = !0, this._prepareBgBuffer());
            var t = this._bgBuffer,
                i = r.DomUtil.TRANSFORM,
                u = n.delta ? r.DomUtil.getTranslateString(n.delta) : t.style[i],
                f = r.DomUtil.getScaleString(n.scale, n.origin);
            t.style[i] = n.backwards ? f + " " + u : u + " " + f
        },
        _endZoomAnim: function() {
            var n = this._tileContainer,
                t = this._bgBuffer;
            n.style.visibility = "";
            n.parentNode.appendChild(n);
            r.Util.falseFn(t.offsetWidth);
            this._animating = !1
        },
        _clearBgBuffer: function() {
            var n = this._map;
            !n || n._animatingZoom || n.touchZoom._zooming || (this._bgBuffer.innerHTML = "", this._bgBuffer.style[r.DomUtil.TRANSFORM] = "")
        },
        _prepareBgBuffer: function() {
            var t = this._tileContainer,
                n = this._bgBuffer,
                i = this._getLoadedTilesPercentage(n),
                u = this._getLoadedTilesPercentage(t);
            return n && i > .5 && .5 > u ? (t.style.visibility = "hidden", void this._stopLoadingImages(t)) : (n.style.visibility = "hidden", n.style[r.DomUtil.TRANSFORM] = "", this._tileContainer = n, n = this._bgBuffer = t, this._stopLoadingImages(n), void clearTimeout(this._clearBgBufferTimer))
        },
        _getLoadedTilesPercentage: function(n) {
            for (var r = n.getElementsByTagName("img"), u = 0, t = 0, i = r.length; i > t; t++) r[t].complete && u++;
            return u / i
        },
        _stopLoadingImages: function(n) {
            for (var t, f = Array.prototype.slice.call(n.getElementsByTagName("img")), i = 0, u = f.length; u > i; i++) t = f[i], t.complete || (t.onload = r.Util.falseFn, t.onerror = r.Util.falseFn, t.src = r.Util.emptyImageUrl, t.parentNode.removeChild(t))
        }
    });
    r.Map.include({
        _defaultLocateOptions: {
            watch: !1,
            setView: !1,
            maxZoom: 1 / 0,
            timeout: 1e4,
            maximumAge: 0,
            enableHighAccuracy: !1
        },
        locate: function(n) {
            if (n = this._locateOptions = r.extend(this._defaultLocateOptions, n), !navigator.geolocation) return this._handleGeolocationError({
                code: 0,
                message: "Geolocation not supported."
            }), this;
            var t = r.bind(this._handleGeolocationResponse, this),
                i = r.bind(this._handleGeolocationError, this);
            return n.watch ? this._locationWatchId = navigator.geolocation.watchPosition(t, i, n) : navigator.geolocation.getCurrentPosition(t, i, n), this
        },
        stopLocate: function() {
            return navigator.geolocation && navigator.geolocation.clearWatch(this._locationWatchId), this._locateOptions && (this._locateOptions.setView = !1), this
        },
        _handleGeolocationError: function(n) {
            var t = n.code,
                i = n.message || (1 === t ? "permission denied" : 2 === t ? "position unavailable" : "timeout");
            this._locateOptions.setView && !this._loaded && this.fitWorld();
            this.fire("locationerror", {
                code: t,
                message: "Geolocation error: " + i + "."
            })
        },
        _handleGeolocationResponse: function(n) {
            var t = n.coords.latitude,
                u = n.coords.longitude,
                o = new r.LatLng(t, u),
                f = 180 * n.coords.accuracy / 40075017,
                s = f / Math.cos(r.LatLng.DEG_TO_RAD * t),
                h = r.latLngBounds([t - f, u - s], [t + f, u + s]),
                c = this._locateOptions,
                l, e, i;
            c.setView && (l = Math.min(this.getBoundsZoom(h), c.maxZoom), this.setView(o, l));
            e = {
                latlng: o,
                bounds: h,
                timestamp: n.timestamp
            };
            for (i in n.coords) "number" == typeof n.coords[i] && (e[i] = n.coords[i]);
            this.fire("locationfound", e)
        }
    })
}(window, document),
function(n, t) {
    L.MarkerClusterGroup = L.FeatureGroup.extend({
        options: {
            maxClusterRadius: 80,
            iconCreateFunction: null,
            spiderfyOnMaxZoom: !0,
            showCoverageOnHover: !0,
            zoomToBoundsOnClick: !0,
            singleMarkerMode: !1,
            disableClusteringAtZoom: null,
            removeOutsideVisibleBounds: !0,
            animateAddingMarkers: !1,
            spiderfyDistanceMultiplier: 1,
            chunkedLoading: !1,
            chunkInterval: 200,
            chunkDelay: 50,
            chunkProgress: null,
            polygonOptions: {}
        },
        initialize: function(n) {
            L.Util.setOptions(this, n);
            this.options.iconCreateFunction || (this.options.iconCreateFunction = this._defaultIconCreateFunction);
            this._featureGroup = L.featureGroup();
            this._featureGroup.on(L.FeatureGroup.EVENTS, this._propagateEvent, this);
            this._nonPointGroup = L.featureGroup();
            this._nonPointGroup.on(L.FeatureGroup.EVENTS, this._propagateEvent, this);
            this._inZoomAnimation = 0;
            this._needsClustering = [];
            this._needsRemoving = [];
            this._currentShownBounds = null;
            this._queue = []
        },
        addLayer: function(n) {
            var i, r, t, u;
            if (n instanceof L.LayerGroup) {
                i = [];
                for (r in n._layers) i.push(n._layers[r]);
                return this.addLayers(i)
            }
            if (!n.getLatLng) return this._nonPointGroup.addLayer(n), this;
            if (!this._map) return this._needsClustering.push(n), this;
            if (this.hasLayer(n)) return this;
            if (this._unspiderfy && this._unspiderfy(), this._addLayer(n, this._maxZoom), t = n, u = this._map.getZoom(), n.__parent)
                while (t.__parent._zoom >= u) t = t.__parent;
            return this._currentShownBounds.contains(t.getLatLng()) && (this.options.animateAddingMarkers ? this._animationAddLayer(n, t) : this._animationAddLayerNonAnimated(n, t)), this
        },
        removeLayer: function(n) {
            var t, i;
            if (n instanceof L.LayerGroup) {
                t = [];
                for (i in n._layers) t.push(n._layers[i]);
                return this.removeLayers(t)
            }
            return n.getLatLng ? this._map ? n.__parent ? (this._unspiderfy && (this._unspiderfy(), this._unspiderfyLayer(n)), this._removeLayer(n, !0), this._featureGroup.hasLayer(n) && (this._featureGroup.removeLayer(n), n.setOpacity && n.setOpacity(1)), this) : this : (!this._arraySplice(this._needsClustering, n) && this.hasLayer(n) && this._needsRemoving.push(n), this) : (this._nonPointGroup.removeLayer(n), this)
        },
        addLayers: function(n) {
            var h = this._featureGroup,
                f = this._nonPointGroup,
                c = this.options.chunkInterval,
                e = this.options.chunkProgress,
                u, r, o, t;
            if (this._map) {
                var i = 0,
                    l = (new Date).getTime(),
                    s = L.bind(function() {
                        for (var a = (new Date).getTime(), u, r, o; i < n.length; i++) {
                            if (i % 200 == 0 && (u = (new Date).getTime() - a, u > c)) break;
                            if (t = n[i], !t.getLatLng) {
                                f.addLayer(t);
                                continue
                            }
                            this.hasLayer(t) || (this._addLayer(t, this._maxZoom), t.__parent && t.__parent.getChildCount() === 2 && (r = t.__parent.getAllChildMarkers(), o = r[0] === t ? r[1] : r[0], h.removeLayer(o)))
                        }
                        e && e(i, n.length, (new Date).getTime() - l);
                        i === n.length ? (this._featureGroup.eachLayer(function(n) {
                            n instanceof L.MarkerCluster && n._iconNeedsUpdate && n._updateIcon()
                        }), this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds)) : setTimeout(s, this.options.chunkDelay)
                    }, this);
                s()
            } else {
                for (u = [], r = 0, o = n.length; r < o; r++) {
                    if (t = n[r], !t.getLatLng) {
                        f.addLayer(t);
                        continue
                    }
                    this.hasLayer(t) || u.push(t)
                }
                this._needsClustering = this._needsClustering.concat(u)
            }
            return this
        },
        removeLayers: function(n) {
            var i, r, t, u = this._featureGroup,
                f = this._nonPointGroup;
            if (!this._map) {
                for (i = 0, r = n.length; i < r; i++) t = n[i], this._arraySplice(this._needsClustering, t), f.removeLayer(t);
                return this
            }
            for (i = 0, r = n.length; i < r; i++) {
                if (t = n[i], !t.__parent) {
                    f.removeLayer(t);
                    continue
                }
                this._removeLayer(t, !0, !0);
                u.hasLayer(t) && (u.removeLayer(t), t.setOpacity && t.setOpacity(1))
            }
            return this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds), u.eachLayer(function(n) {
                n instanceof L.MarkerCluster && n._updateIcon()
            }), this
        },
        clearLayers: function() {
            return this._map || (this._needsClustering = [], delete this._gridClusters, delete this._gridUnclustered), this._noanimationUnspiderfy && this._noanimationUnspiderfy(), this._featureGroup.clearLayers(), this._nonPointGroup.clearLayers(), this.eachLayer(function(n) {
                delete n.__parent
            }), this._map && this._generateInitialClusters(), this
        },
        getBounds: function() {
            var n = new L.LatLngBounds,
                t;
            if (this._topClusterLevel) n.extend(this._topClusterLevel._bounds);
            else
                for (t = this._needsClustering.length - 1; t >= 0; t--) n.extend(this._needsClustering[t].getLatLng());
            return n.extend(this._nonPointGroup.getBounds()), n
        },
        eachLayer: function(n, t) {
            var r = this._needsClustering.slice(),
                i;
            for (this._topClusterLevel && this._topClusterLevel.getAllChildMarkers(r), i = r.length - 1; i >= 0; i--) n.call(t, r[i]);
            this._nonPointGroup.eachLayer(n, t)
        },
        getLayers: function() {
            var n = [];
            return this.eachLayer(function(t) {
                n.push(t)
            }), n
        },
        getLayer: function(n) {
            var t = null;
            return this.eachLayer(function(i) {
                L.stamp(i) === n && (t = i)
            }), t
        },
        hasLayer: function(n) {
            if (!n) return !1;
            for (var i = this._needsClustering, t = i.length - 1; t >= 0; t--)
                if (i[t] === n) return !0;
            for (i = this._needsRemoving, t = i.length - 1; t >= 0; t--)
                if (i[t] === n) return !1;
            return !!(n.__parent && n.__parent._group === this) || this._nonPointGroup.hasLayer(n)
        },
        zoomToShowLayer: function(n, t) {
            var i = function() {
                if ((n._icon || n.__parent._icon) && !this._inZoomAnimation)
                    if (this._map.off("moveend", i, this), this.off("animationend", i, this), n._icon) t();
                    else if (n.__parent._icon) {
                    var r = function() {
                        this.off("spiderfied", r, this);
                        t()
                    };
                    this.on("spiderfied", r, this);
                    n.__parent.spiderfy()
                }
            };
            if (n._icon && this._map.getBounds().contains(n.getLatLng())) t();
            else if (n.__parent._zoom < this._map.getZoom()) {
                this._map.on("moveend", i, this);
                this._map.panTo(n.getLatLng())
            } else {
                this._map.on("moveend", i, this);
                this.on("animationend", i, this);
                this._map.setView(n.getLatLng(), n.__parent._zoom + 1);
                n.__parent.zoomToBounds()
            }
        },
        onAdd: function(n) {
            this._map = n;
            var t, i, r;
            if (!isFinite(this._map.getMaxZoom())) throw "Map has no maxZoom specified";
            this._featureGroup.onAdd(n);
            this._nonPointGroup.onAdd(n);
            for (this._gridClusters || this._generateInitialClusters(), t = 0, i = this._needsRemoving.length; t < i; t++) r = this._needsRemoving[t], this._removeLayer(r, !0);
            this._needsRemoving = [];
            this._zoom = this._map.getZoom();
            this._currentShownBounds = this._getExpandedVisibleBounds();
            this._map.on("zoomend", this._zoomEnd, this);
            this._map.on("moveend", this._moveEnd, this);
            this._spiderfierOnAdd && this._spiderfierOnAdd();
            this._bindEvents();
            i = this._needsClustering;
            this._needsClustering = [];
            this.addLayers(i)
        },
        onRemove: function(n) {
            n.off("zoomend", this._zoomEnd, this);
            n.off("moveend", this._moveEnd, this);
            this._unbindEvents();
            this._map._mapPane.className = this._map._mapPane.className.replace(" tmap-cluster-anim", "");
            this._spiderfierOnRemove && this._spiderfierOnRemove();
            this._hideCoverage();
            this._featureGroup.onRemove(n);
            this._nonPointGroup.onRemove(n);
            this._featureGroup.clearLayers();
            this._map = null
        },
        getVisibleParent: function(n) {
            for (var t = n; t && !t._icon;) t = t.__parent;
            return t || null
        },
        _arraySplice: function(n, t) {
            for (var i = n.length - 1; i >= 0; i--)
                if (n[i] === t) return n.splice(i, 1), !0
        },
        _removeLayer: function(n, t, i) {
            var c = this._gridClusters,
                o = this._gridUnclustered,
                s = this._featureGroup,
                e = this._map,
                f, r, h, u;
            if (t)
                for (f = this._maxZoom; f >= 0; f--)
                    if (!o[f].removeObject(n, e.project(n.getLatLng(), f))) break;
            for (r = n.__parent, h = r._markers, this._arraySplice(h, n); r;) {
                if (r._childCount--, r._zoom < 0) break;
                else t && r._childCount <= 1 ? (u = r._markers[0] === n ? r._markers[1] : r._markers[0], c[r._zoom].removeObject(r, e.project(r._cLatLng, r._zoom)), o[r._zoom].addObject(u, e.project(u.getLatLng(), r._zoom)), this._arraySplice(r.__parent._childClusters, r), r.__parent._markers.push(u), u.__parent = r.__parent, r._icon && (s.removeLayer(r), i || s.addLayer(u))) : (r._recalculateBounds(), i && r._icon || r._updateIcon());
                r = r.__parent
            }
            delete n.__parent
        },
        _isOrIsParent: function(n, t) {
            while (t) {
                if (n === t) return !0;
                t = t.parentNode
            }
            return !1
        },
        _propagateEvent: function(n) {
            if (n.layer instanceof L.MarkerCluster) {
                if (n.originalEvent && this._isOrIsParent(n.layer._icon, n.originalEvent.relatedTarget)) return;
                n.type = "cluster" + n.type
            }
            this.fire(n.type, n)
        },
        _defaultIconCreateFunction: function(n) {
            var t = n.getChildCount(),
                i = " marker-cluster-";
            return i += t < 10 ? "small" : t < 100 ? "medium" : "large", new L.DivIcon({
                html: "<div><span>" + t + "<\/span><\/div>",
                className: "marker-cluster" + i,
                iconSize: new L.Point(40, 40)
            })
        },
        _bindEvents: function() {
            var n = this._map,
                t = this.options.spiderfyOnMaxZoom,
                i = this.options.showCoverageOnHover,
                r = this.options.zoomToBoundsOnClick;
            if (t || r) this.on("clusterclick", this._zoomOrSpiderfy, this);
            if (i) {
                this.on("clustermouseover", this._showCoverage, this);
                this.on("clustermouseout", this._hideCoverage, this);
                n.on("zoomend", this._hideCoverage, this)
            }
        },
        _zoomOrSpiderfy: function(n) {
            var t = this._map;
            t.getMaxZoom() === t.getZoom() ? this.options.spiderfyOnMaxZoom && n.layer.spiderfy() : this.options.zoomToBoundsOnClick && (n.layer._childCount > 8 ? n.layer.zoomToBounds() : n.layer.spiderfy());
            n.originalEvent && n.originalEvent.keyCode === 13 && t._container.focus()
        },
        _showCoverage: function(n) {
            var t = this._map;
            this._inZoomAnimation || (this._shownPolygon && t.removeLayer(this._shownPolygon), n.layer.getChildCount() > 2 && n.layer !== this._spiderfied && (this._shownPolygon = new L.Polygon(n.layer.getConvexHull(), this.options.polygonOptions), t.addLayer(this._shownPolygon)))
        },
        _hideCoverage: function() {
            this._shownPolygon && (this._map.removeLayer(this._shownPolygon), this._shownPolygon = null)
        },
        _unbindEvents: function() {
            var n = this.options.spiderfyOnMaxZoom,
                t = this.options.showCoverageOnHover,
                i = this.options.zoomToBoundsOnClick,
                r = this._map;
            (n || i) && this.off("clusterclick", this._zoomOrSpiderfy, this);
            t && (this.off("clustermouseover", this._showCoverage, this), this.off("clustermouseout", this._hideCoverage, this), r.off("zoomend", this._hideCoverage, this))
        },
        _zoomEnd: function() {
            this._map && (this._mergeSplitClusters(), this._zoom = this._map._zoom, this._currentShownBounds = this._getExpandedVisibleBounds())
        },
        _moveEnd: function() {
            if (!this._inZoomAnimation) {
                var n = this._getExpandedVisibleBounds();
                this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, n);
                this._topClusterLevel._recursivelyAddChildrenToMap(null, this._map._zoom, n);
                this._currentShownBounds = n;
                return
            }
        },
        _generateInitialClusters: function() {
            var t = this._map.getMaxZoom(),
                i = this.options.maxClusterRadius,
                r = i,
                n;
            for (typeof i != "function" && (r = function() {
                    return i
                }), this.options.disableClusteringAtZoom && (t = this.options.disableClusteringAtZoom - 1), this._maxZoom = t, this._gridClusters = {}, this._gridUnclustered = {}, n = t; n >= 0; n--) this._gridClusters[n] = new L.DistanceGrid(r(n)), this._gridUnclustered[n] = new L.DistanceGrid(r(n));
            this._topClusterLevel = new L.MarkerCluster(this, -1)
        },
        _addLayer: function(n, t) {
            var s = this._gridClusters,
                h = this._gridUnclustered,
                e, r, i, o, u, f;
            for (this.options.singleMarkerMode && (n.options.icon = this.options.iconCreateFunction({
                    getChildCount: function() {
                        return 1
                    },
                    getAllChildMarkers: function() {
                        return [n]
                    }
                })); t >= 0; t--) {
                if (e = this._map.project(n.getLatLng(), t), i = s[t].getNearObject(e), i) {
                    i._addChild(n);
                    n.__parent = i;
                    return
                }
                if (i = h[t].getNearObject(e), i) {
                    for (o = i.__parent, o && this._removeLayer(i, !1), u = new L.MarkerCluster(this, t, i, n), s[t].addObject(u, this._map.project(u._cLatLng, t)), i.__parent = u, n.__parent = u, f = u, r = t - 1; r > o._zoom; r--) f = new L.MarkerCluster(this, r, f), s[r].addObject(f, this._map.project(i.getLatLng(), r));
                    for (o._addChild(f), r = t; r >= 0; r--)
                        if (!h[r].removeObject(i, this._map.project(i.getLatLng(), r))) break;
                    return
                }
                h[t].addObject(n, e)
            }
            this._topClusterLevel._addChild(n);
            n.__parent = this._topClusterLevel;
            return
        },
        _enqueue: function(n) {
            this._queue.push(n);
            this._queueTimeout || (this._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300))
        },
        _processQueue: function() {
            for (var n = 0; n < this._queue.length; n++) this._queue[n].call(this);
            this._queue.length = 0;
            clearTimeout(this._queueTimeout);
            this._queueTimeout = null
        },
        _mergeSplitClusters: function() {
            this._processQueue();
            this._zoom < this._map._zoom && this._currentShownBounds.contains(this._getExpandedVisibleBounds()) ? (this._animationStart(), this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, this._getExpandedVisibleBounds()), this._animationZoomIn(this._zoom, this._map._zoom)) : this._zoom > this._map._zoom ? (this._animationStart(), this._animationZoomOut(this._zoom, this._map._zoom)) : this._moveEnd()
        },
        _getExpandedVisibleBounds: function() {
            if (!this.options.removeOutsideVisibleBounds) return this.getBounds();
            var f = this._map,
                i = f.getBounds(),
                n = i._southWest,
                t = i._northEast,
                r = L.Browser.mobile ? 0 : Math.abs(n.lat - t.lat),
                u = L.Browser.mobile ? 0 : Math.abs(n.lng - t.lng);
            return new L.LatLngBounds(new L.LatLng(n.lat - r, n.lng - u, !0), new L.LatLng(t.lat + r, t.lng + u, !0))
        },
        _animationAddLayerNonAnimated: function(n, t) {
            if (t === n) this._featureGroup.addLayer(n);
            else if (t._childCount === 2) {
                t._addToMap();
                var i = t.getAllChildMarkers();
                this._featureGroup.removeLayer(i[0]);
                this._featureGroup.removeLayer(i[1])
            } else t._updateIcon()
        }
    });
    L.MarkerClusterGroup.include(L.DomUtil.TRANSITION ? {
        _animationStart: function() {
            this._map._mapPane.className += " tmap-cluster-anim";
            this._inZoomAnimation++
        },
        _animationEnd: function() {
            this._map && (this._map._mapPane.className = this._map._mapPane.className.replace(" tmap-cluster-anim", ""));
            this._inZoomAnimation--;
            this.fire("animationend")
        },
        _animationZoomIn: function(n, t) {
            var i = this._getExpandedVisibleBounds(),
                r = this._featureGroup,
                u;
            this._topClusterLevel._recursively(i, n, 0, function(f) {
                var e = f._latlng,
                    s = f._markers,
                    o;
                for (i.contains(e) || (e = null), f._isSingleParent() && n + 1 === t ? (r.removeLayer(f), f._recursivelyAddChildrenToMap(null, t, i)) : (f.setOpacity(0), f._recursivelyAddChildrenToMap(e, t, i)), u = s.length - 1; u >= 0; u--) o = s[u], i.contains(o._latlng) || r.removeLayer(o)
            });
            this._forceLayout();
            this._topClusterLevel._recursivelyBecomeVisible(i, t);
            r.eachLayer(function(n) {
                n instanceof L.MarkerCluster || !n._icon || n.setOpacity(1)
            });
            this._topClusterLevel._recursively(i, n, t, function(n) {
                n._recursivelyRestoreChildPositions(t)
            });
            this._enqueue(function() {
                this._topClusterLevel._recursively(i, n, 0, function(n) {
                    r.removeLayer(n);
                    n.setOpacity(1)
                });
                this._animationEnd()
            })
        },
        _animationZoomOut: function(n, t) {
            this._animationZoomOutSingle(this._topClusterLevel, n - 1, t);
            this._topClusterLevel._recursivelyAddChildrenToMap(null, t, this._getExpandedVisibleBounds());
            this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, n, this._getExpandedVisibleBounds())
        },
        _animationZoomOutSingle: function(n, t, i) {
            var r = this._getExpandedVisibleBounds(),
                u;
            n._recursivelyAnimateChildrenInAndAddSelfToMap(r, t + 1, i);
            u = this;
            this._forceLayout();
            n._recursivelyBecomeVisible(r, i);
            this._enqueue(function() {
                if (n._childCount === 1) {
                    var f = n._markers[0];
                    f.setLatLng(f.getLatLng());
                    f.setOpacity && f.setOpacity(1)
                } else n._recursively(r, i, 0, function(n) {
                    n._recursivelyRemoveChildrenFromMap(r, t + 1)
                });
                u._animationEnd()
            })
        },
        _animationAddLayer: function(n, t) {
            var i = this,
                r = this._featureGroup;
            r.addLayer(n);
            t !== n && (t._childCount > 2 ? (t._updateIcon(), this._forceLayout(), this._animationStart(), n._setPos(this._map.latLngToLayerPoint(t.getLatLng())), n.setOpacity(0), this._enqueue(function() {
                r.removeLayer(n);
                n.setOpacity(1);
                i._animationEnd()
            })) : (this._forceLayout(), i._animationStart(), i._animationZoomOutSingle(t, this._map.getMaxZoom(), this._map.getZoom())))
        },
        _forceLayout: function() {
            L.Util.falseFn(t.body.offsetWidth)
        }
    } : {
        _animationStart: function() {},
        _animationZoomIn: function(n, t) {
            this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, n);
            this._topClusterLevel._recursivelyAddChildrenToMap(null, t, this._getExpandedVisibleBounds())
        },
        _animationZoomOut: function(n, t) {
            this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, n);
            this._topClusterLevel._recursivelyAddChildrenToMap(null, t, this._getExpandedVisibleBounds())
        },
        _animationAddLayer: function(n, t) {
            this._animationAddLayerNonAnimated(n, t)
        }
    });
    L.markerClusterGroup = function(n) {
        return new L.MarkerClusterGroup(n)
    };
    L.MarkerCluster = L.Marker.extend({
        initialize: function(n, t, i, r) {
            L.Marker.prototype.initialize.call(this, i ? i._cLatLng || i.getLatLng() : new L.LatLng(0, 0), {
                icon: this
            });
            this._group = n;
            this._zoom = t;
            this._markers = [];
            this._childClusters = [];
            this._childCount = 0;
            this._iconNeedsUpdate = !0;
            this._bounds = new L.LatLngBounds;
            i && this._addChild(i);
            r && this._addChild(r)
        },
        getAllChildMarkers: function(n) {
            var t, i;
            for (n = n || [], t = this._childClusters.length - 1; t >= 0; t--) this._childClusters[t].getAllChildMarkers(n);
            for (i = this._markers.length - 1; i >= 0; i--) n.push(this._markers[i]);
            return n
        },
        getChildCount: function() {
            return this._childCount
        },
        zoomToBounds: function() {
            for (var n = this._childClusters.slice(), f = this._group._map, u = f.getBoundsZoom(this._bounds), t = this._zoom + 1, e = f.getZoom(), i, r; n.length > 0 && u > t;) {
                for (t++, r = [], i = 0; i < n.length; i++) r = r.concat(n[i]._childClusters);
                n = r
            }
            u > t ? this._group._map.setView(this._latlng, t) : u <= e ? this._group._map.setView(this._latlng, e + 1) : this._group._map.fitBounds(this._bounds)
        },
        getBounds: function() {
            var n = new L.LatLngBounds;
            return n.extend(this._bounds), n
        },
        _updateIcon: function() {
            this._iconNeedsUpdate = !0;
            this._icon && this.setIcon(this)
        },
        createIcon: function() {
            return this._iconNeedsUpdate && (this._iconObj = this._group.options.iconCreateFunction(this), this._iconNeedsUpdate = !1), this._iconObj.createIcon()
        },
        createShadow: function() {
            return this._iconObj.createShadow()
        },
        _addChild: function(n, t) {
            this._iconNeedsUpdate = !0;
            this._expandBounds(n);
            n instanceof L.MarkerCluster ? (t || (this._childClusters.push(n), n.__parent = this), this._childCount += n._childCount) : (t || this._markers.push(n), this._childCount++);
            this.__parent && this.__parent._addChild(n, !0)
        },
        _expandBounds: function(n) {
            var i, t = n._wLatLng || n._latlng,
                r;
            n instanceof L.MarkerCluster ? (this._bounds.extend(n._bounds), i = n._childCount) : (this._bounds.extend(t), i = 1);
            this._cLatLng || (this._cLatLng = n._cLatLng || t);
            r = this._childCount + i;
            this._wLatLng ? (this._wLatLng.lat = (t.lat * i + this._wLatLng.lat * this._childCount) / r, this._wLatLng.lng = (t.lng * i + this._wLatLng.lng * this._childCount) / r) : this._latlng = this._wLatLng = new L.LatLng(t.lat, t.lng)
        },
        _addToMap: function(n) {
            n && (this._backupLatlng = this._latlng, this.setLatLng(n));
            this._group._featureGroup.addLayer(this)
        },
        _recursivelyAnimateChildrenIn: function(n, t, i) {
            this._recursively(n, 0, i - 1, function(n) {
                for (var u = n._markers, r, i = u.length - 1; i >= 0; i--) r = u[i], r._icon && (r._setPos(t), r.setOpacity(0))
            }, function(n) {
                for (var u = n._childClusters, r, i = u.length - 1; i >= 0; i--) r = u[i], r._icon && (r._setPos(t), r.setOpacity(0))
            })
        },
        _recursivelyAnimateChildrenInAndAddSelfToMap: function(n, t, i) {
            this._recursively(n, i, 0, function(r) {
                r._recursivelyAnimateChildrenIn(n, r._group._map.latLngToLayerPoint(r.getLatLng()).round(), t);
                r._isSingleParent() && t - 1 === i ? (r.setOpacity(1), r._recursivelyRemoveChildrenFromMap(n, t)) : r.setOpacity(0);
                r._addToMap()
            })
        },
        _recursivelyBecomeVisible: function(n, t) {
            this._recursively(n, 0, t, null, function(n) {
                n.setOpacity(1)
            })
        },
        _recursivelyAddChildrenToMap: function(n, t, i) {
            this._recursively(i, -1, t, function(r) {
                var f, u;
                if (t !== r._zoom)
                    for (f = r._markers.length - 1; f >= 0; f--)(u = r._markers[f], i.contains(u._latlng)) && (n && (u._backupLatlng = u.getLatLng(), u.setLatLng(n), u.setOpacity && u.setOpacity(0)), r._group._featureGroup.addLayer(u))
            }, function(t) {
                t._addToMap(n)
            })
        },
        _recursivelyRestoreChildPositions: function(n) {
            for (var t, r, u, i = this._markers.length - 1; i >= 0; i--) t = this._markers[i], t._backupLatlng && (t.setLatLng(t._backupLatlng), delete t._backupLatlng);
            if (n - 1 === this._zoom)
                for (r = this._childClusters.length - 1; r >= 0; r--) this._childClusters[r]._restorePosition();
            else
                for (u = this._childClusters.length - 1; u >= 0; u--) this._childClusters[u]._recursivelyRestoreChildPositions(n)
        },
        _restorePosition: function() {
            this._backupLatlng && (this.setLatLng(this._backupLatlng), delete this._backupLatlng)
        },
        _recursivelyRemoveChildrenFromMap: function(n, t, i) {
            var r, u;
            this._recursively(n, -1, t - 1, function(n) {
                for (u = n._markers.length - 1; u >= 0; u--) r = n._markers[u], i && i.contains(r._latlng) || (n._group._featureGroup.removeLayer(r), r.setOpacity && r.setOpacity(1))
            }, function(n) {
                for (u = n._childClusters.length - 1; u >= 0; u--) r = n._childClusters[u], i && i.contains(r._latlng) || (n._group._featureGroup.removeLayer(r), r.setOpacity && r.setOpacity(1))
            })
        },
        _recursively: function(n, t, i, r, u) {
            var o = this._childClusters,
                s = this._zoom,
                f, e;
            if (t > s)
                for (f = o.length - 1; f >= 0; f--) e = o[f], n.intersects(e._bounds) && e._recursively(n, t, i, r, u);
            else if (r && r(this), u && this._zoom === i && u(this), i > s)
                for (f = o.length - 1; f >= 0; f--) e = o[f], n.intersects(e._bounds) && e._recursively(n, t, i, r, u)
        },
        _recalculateBounds: function() {
            var t = this._markers,
                i = this._childClusters,
                n;
            for (this._bounds = new L.LatLngBounds, delete this._wLatLng, n = t.length - 1; n >= 0; n--) this._expandBounds(t[n]);
            for (n = i.length - 1; n >= 0; n--) this._expandBounds(i[n])
        },
        _isSingleParent: function() {
            return this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount
        }
    });
    L.DistanceGrid = function(n) {
        this._cellSize = n;
        this._sqCellSize = n * n;
        this._grid = {};
        this._objectPoint = {}
    };
    L.DistanceGrid.prototype = {
            addObject: function(n, t) {
                var i = this._getCoord(t.x),
                    r = this._getCoord(t.y),
                    u = this._grid,
                    f = u[r] = u[r] || {},
                    e = f[i] = f[i] || [],
                    o = L.Util.stamp(n);
                this._objectPoint[o] = t;
                e.push(n)
            },
            updateObject: function(n, t) {
                this.removeObject(n);
                this.addObject(n, t)
            },
            removeObject: function(n, t) {
                var r = this._getCoord(t.x),
                    o = this._getCoord(t.y),
                    s = this._grid,
                    u = s[o] = s[o] || {},
                    f = u[r] = u[r] || [],
                    i, e;
                for (delete this._objectPoint[L.Util.stamp(n)], i = 0, e = f.length; i < e; i++)
                    if (f[i] === n) return f.splice(i, 1), e === 1 && delete u[r], !0
            },
            eachObject: function(n, t) {
                var e, o, i, r, u, f, s, h = this._grid;
                for (e in h) {
                    u = h[e];
                    for (o in u)
                        for (f = u[o], i = 0, r = f.length; i < r; i++) s = n.call(t, f[i]), s && (i--, r--)
                }
            },
            getNearObject: function(n) {
                for (var s = this._getCoord(n.x), h = this._getCoord(n.y), i, r, f, u, c, e, o, v = this._objectPoint, l = this._sqCellSize, a = null, t = h - 1; t <= h + 1; t++)
                    if (f = this._grid[t], f)
                        for (i = s - 1; i <= s + 1; i++)
                            if (u = f[i], u)
                                for (r = 0, c = u.length; r < c; r++) e = u[r], o = this._sqDist(v[L.Util.stamp(e)], n), o < l && (l = o, a = e);
                return a
            },
            _getCoord: function(n) {
                return Math.floor(n / this._cellSize)
            },
            _sqDist: function(n, t) {
                var i = t.x - n.x,
                    r = t.y - n.y;
                return i * i + r * r
            }
        },
        function() {
            L.QuickHull = {
                getDistant: function(n, t) {
                    var i = t[1].lat - t[0].lat,
                        r = t[0].lng - t[1].lng;
                    return r * (n.lat - t[0].lat) + i * (n.lng - t[0].lng)
                },
                findMostDistantPointFromBaseLine: function(n, t) {
                    for (var f = 0, e = null, o = [], r, u, i = t.length - 1; i >= 0; i--) {
                        if (r = t[i], u = this.getDistant(r, n), u > 0) o.push(r);
                        else continue;
                        u > f && (f = u, e = r)
                    }
                    return {
                        maxPoint: e,
                        newPoints: o
                    }
                },
                buildConvexHull: function(n, t) {
                    var r = [],
                        i = this.findMostDistantPointFromBaseLine(n, t);
                    return i.maxPoint ? (r = r.concat(this.buildConvexHull([n[0], i.maxPoint], i.newPoints)), r.concat(this.buildConvexHull([i.maxPoint, n[1]], i.newPoints))) : [n[0]]
                },
                getConvexHull: function(n) {
                    for (var r = !1, u = !1, f = null, e = null, t, i = n.length - 1; i >= 0; i--) t = n[i], (r === !1 || t.lat > r) && (f = t, r = t.lat), (u === !1 || t.lat < u) && (e = t, u = t.lat);
                    return [].concat(this.buildConvexHull([e, f], n), this.buildConvexHull([f, e], n))
                }
            }
        }();
    L.MarkerCluster.include({
        getConvexHull: function() {
            for (var t = this.getAllChildMarkers(), i = [], r, n = t.length - 1; n >= 0; n--) r = t[n].getLatLng(), i.push(r);
            return L.QuickHull.getConvexHull(i)
        }
    });
    L.MarkerCluster.include({
        _2PI: Math.PI * 2,
        _circleFootSeparation: 25,
        _circleStartAngle: Math.PI / 6,
        _spiralFootSeparation: 28,
        _spiralLengthStart: 11,
        _spiralLengthFactor: 5,
        _circleSpiralSwitchover: 9,
        spiderfy: function() {
            if (this._group._spiderfied !== this && !this._group._inZoomAnimation) {
                var n = this.getAllChildMarkers(),
                    r = this._group,
                    u = r._map,
                    t = u.latLngToLayerPoint(this._latlng),
                    i;
                this._group._unspiderfy();
                this._group._spiderfied = this;
                n.length >= this._circleSpiralSwitchover ? i = this._generatePointsSpiral(n.length, t) : (t.y += 10, i = this._generatePointsCircle(n.length, t));
                this._animationSpiderfy(n, i)
            }
        },
        unspiderfy: function(n) {
            this._group._inZoomAnimation || (this._animationUnspiderfy(n), this._group._spiderfied = null)
        },
        _generatePointsCircle: function(n, t) {
            var e = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + n),
                f = 30 + e / this._2PI,
                o = this._2PI / n,
                r = [],
                i, u;
            for (r.length = n, i = n - 1; i >= 0; i--) u = this._circleStartAngle + i * o, r[i] = new L.Point(t.x + f * Math.cos(u), t.y + f * Math.sin(u))._round();
            return r
        },
        _generatePointsSpiral: function(n, t) {
            var r = this._group.options.spiderfyDistanceMultiplier * this._spiralLengthStart,
                e = this._group.options.spiderfyDistanceMultiplier * this._spiralFootSeparation,
                o = this._group.options.spiderfyDistanceMultiplier * this._spiralLengthFactor,
                u = 0,
                f = [],
                i;
            for (f.length = n, i = n - 1; i >= 0; i--) u += e / r + i * .0005, f[i] = new L.Point(t.x + r * Math.cos(u), t.y + r * Math.sin(u))._round(), r += this._2PI * o / u;
            return f
        },
        _noanimationUnspiderfy: function() {
            var i = this._group,
                u = i._map,
                f = i._featureGroup,
                r = this.getAllChildMarkers(),
                n, t;
            for (this.setOpacity(1), t = r.length - 1; t >= 0; t--) n = r[t], f.removeLayer(n), n._preSpiderfyLatlng && (n.setLatLng(n._preSpiderfyLatlng), delete n._preSpiderfyLatlng), n.setZIndexOffset && n.setZIndexOffset(0), n._spiderLeg && (u.removeLayer(n._spiderLeg), delete n._spiderLeg);
            i._spiderfied = null
        }
    });
    L.MarkerCluster.include(L.DomUtil.TRANSITION ? {
        SVG_ANIMATION: function() {
            return t.createElementNS("http://www.w3.org/2000/svg", "animate").toString().indexOf("SVGAnimate") > -1
        }(),
        _animationSpiderfy: function(n, i) {
            for (var a = this, o = this._group, h = o._map, v = o._featureGroup, p = h.latLngToLayerPoint(this._latlng), r, e, c, y, l, s, u, f = n.length - 1; f >= 0; f--) r = n[f], r.setOpacity ? (r.setZIndexOffset(1e6), r.setOpacity(0), v.addLayer(r), r._setPos(p)) : v.addLayer(r);
            for (o._forceLayout(), o._animationStart(), y = L.Path.SVG ? 0 : .3, l = L.Path.SVG_NS, f = n.length - 1; f >= 0; f--)(c = h.layerPointToLatLng(i[f]), r = n[f], r._preSpiderfyLatlng = r._latlng, r.setLatLng(c), r.setOpacity && r.setOpacity(1), e = new L.Polyline([a._latlng, c], {
                weight: 1.5,
                color: "#222",
                opacity: y
            }), h.addLayer(e), r._spiderLeg = e, L.Path.SVG && this.SVG_ANIMATION) && (s = e._path.getTotalLength(), e._path.setAttribute("stroke-dasharray", s + "," + s), u = t.createElementNS(l, "animate"), u.setAttribute("attributeName", "stroke-dashoffset"), u.setAttribute("begin", "indefinite"), u.setAttribute("from", s), u.setAttribute("to", 0), u.setAttribute("dur", .25), e._path.appendChild(u), u.beginElement(), u = t.createElementNS(l, "animate"), u.setAttribute("attributeName", "stroke-opacity"), u.setAttribute("attributeName", "stroke-opacity"), u.setAttribute("begin", "indefinite"), u.setAttribute("from", 0), u.setAttribute("to", .5), u.setAttribute("dur", .25), e._path.appendChild(u), u.beginElement());
            if (a.setOpacity(.3), L.Path.SVG)
                for (this._group._forceLayout(), f = n.length - 1; f >= 0; f--) r = n[f]._spiderLeg, r.options.opacity = .5, r._path.setAttribute("stroke-opacity", .5);
            setTimeout(function() {
                o._animationEnd();
                o.fire("spiderfied")
            }, 200)
        },
        _animationUnspiderfy: function(n) {
            var f = this._group,
                e = f._map,
                o = f._featureGroup,
                s = n ? e._latLngToNewLayerPoint(this._latlng, n.zoom, n.center) : e.latLngToLayerPoint(this._latlng),
                u = this.getAllChildMarkers(),
                h = L.Path.SVG && this.SVG_ANIMATION,
                t, i, r;
            for (f._animationStart(), this.setOpacity(1), i = u.length - 1; i >= 0; i--)(t = u[i], t._preSpiderfyLatlng) && (t.setLatLng(t._preSpiderfyLatlng), delete t._preSpiderfyLatlng, t.setOpacity ? (t._setPos(s), t.setOpacity(0)) : o.removeLayer(t), h && (r = t._spiderLeg._path.childNodes[0], r.setAttribute("to", r.getAttribute("from")), r.setAttribute("from", 0), r.beginElement(), r = t._spiderLeg._path.childNodes[1], r.setAttribute("from", .5), r.setAttribute("to", 0), r.setAttribute("stroke-opacity", 0), r.beginElement(), t._spiderLeg._path.setAttribute("stroke-opacity", 0)));
            setTimeout(function() {
                var n = 0;
                for (i = u.length - 1; i >= 0; i--) t = u[i], t._spiderLeg && n++;
                for (i = u.length - 1; i >= 0; i--)(t = u[i], t._spiderLeg) && (t.setOpacity && (t.setOpacity(1), t.setZIndexOffset(0)), n > 1 && o.removeLayer(t), e.removeLayer(t._spiderLeg), delete t._spiderLeg);
                f._animationEnd()
            }, 200)
        }
    } : {
        _animationSpiderfy: function(n, t) {
            for (var u = this._group, o = u._map, s = u._featureGroup, i, f, e, r = n.length - 1; r >= 0; r--) e = o.layerPointToLatLng(t[r]), i = n[r], i._preSpiderfyLatlng = i._latlng, i.setLatLng(e), i.setZIndexOffset && i.setZIndexOffset(1e6), s.addLayer(i), f = new L.Polyline([this._latlng, e], {
                weight: 1.5,
                color: "#222"
            }), o.addLayer(f), i._spiderLeg = f;
            this.setOpacity(.3);
            u.fire("spiderfied")
        },
        _animationUnspiderfy: function() {
            this._noanimationUnspiderfy()
        }
    });
    L.MarkerClusterGroup.include({
        _spiderfied: null,
        _spiderfierOnAdd: function() {
            this._map.on("click", this._unspiderfyWrapper, this);
            if (this._map.options.zoomAnimation) this._map.on("zoomstart", this._unspiderfyZoomStart, this);
            this._map.on("zoomend", this._noanimationUnspiderfy, this);
            L.Path.SVG && !L.Browser.touch && this._map._initPathRoot()
        },
        _spiderfierOnRemove: function() {
            this._map.off("click", this._unspiderfyWrapper, this);
            this._map.off("zoomstart", this._unspiderfyZoomStart, this);
            this._map.off("zoomanim", this._unspiderfyZoomAnim, this);
            this._unspiderfy()
        },
        _unspiderfyZoomStart: function() {
            if (this._map) this._map.on("zoomanim", this._unspiderfyZoomAnim, this)
        },
        _unspiderfyZoomAnim: function(n) {
            L.DomUtil.hasClass(this._map._mapPane, "tmap-touching") || (this._map.off("zoomanim", this._unspiderfyZoomAnim, this), this._unspiderfy(n))
        },
        _unspiderfyWrapper: function() {
            this._unspiderfy()
        },
        _unspiderfy: function(n) {
            this._spiderfied && this._spiderfied.unspiderfy(n)
        },
        _noanimationUnspiderfy: function() {
            this._spiderfied && this._spiderfied._noanimationUnspiderfy()
        },
        _unspiderfyLayer: function(n) {
            n._spiderLeg && (this._featureGroup.removeLayer(n), n.setOpacity(1), n.setZIndexOffset(0), this._map.removeLayer(n._spiderLeg), delete n._spiderLeg)
        }
    })
}(window, document);
L.Ellipse = L.Path.extend({
    initialize: function(n, t, i, r) {
        L.Path.prototype.initialize.call(this, r);
        this._latlng = L.latLng(n);
        this._tiltDeg = i ? i : 0;
        t && (this._mRadiusX = t[0], this._mRadiusY = t[1])
    },
    options: {
        fill: !0,
        startAngle: 0,
        endAngle: 359.9
    },
    setLatLng: function(n) {
        return this._latlng = L.latLng(n), this.redraw()
    },
    setRadius: function(n) {
        return this._mRadiusX = n[0], this._mRadiusY = n[1], this.redraw()
    },
    setTilt: function(n) {
        return this._tiltDeg = n, this.redraw()
    },
    projectLatlngs: function() {
        var t = this._getLngRadius(),
            i = this._getLatRadius(),
            n = this._latlng,
            r = this._map.latLngToLayerPoint([n.lat, n.lng - t]),
            u = this._map.latLngToLayerPoint([n.lat - i, n.lng]);
        this._point = this._map.latLngToLayerPoint(n);
        this._radiusX = Math.max(this._point.x - r.x, 1);
        this._radiusY = Math.max(u.y - this._point.y, 1);
        this._endPointParams = this._centerPointToEndPoint()
    },
    getBounds: function() {
        var t = this._getLngRadius(),
            i = this._getLatRadius(),
            n = this._latlng;
        return new L.LatLngBounds([n.lat - i, n.lng - t], [n.lat + i, n.lng + t])
    },
    getLatLng: function() {
        return this._latlng
    },
    getPathString: function() {
        var r = this._point,
            t = this._radiusX,
            i = this._radiusY,
            u = this._tiltDeg,
            n = this._endPointParams;
        return this._checkIfEmpty() ? "" : L.Browser.svg ? "M" + n.x0 + "," + n.y0 + "A" + t + "," + i + "," + u + "," + n.largeArc + "," + n.sweep + "," + n.x1 + "," + n.y1 + " z" : (r._round(), t = Math.round(t), i = Math.round(i), "AL " + r.x + "," + r.y + " " + t + "," + i + " " + u + ",23592600")
    },
    getRadius: function() {
        return new L.point(this._mRadiusX, this._mRadiusY)
    },
    _centerPointToEndPoint: function() {
        var t = this._point,
            i = this._radiusX,
            r = this._radiusY,
            u = (this.options.startAngle + this.options.endAngle) * L.LatLng.DEG_TO_RAD,
            f = this.options.startAngle * L.LatLng.DEG_TO_RAD,
            e = this.options.endAngle,
            n = this._tiltDeg * L.LatLng.DEG_TO_RAD,
            o = t.x + Math.cos(n) * i * Math.cos(f) + Math.sin(-n) * r * Math.sin(f),
            s = t.y + Math.sin(n) * i * Math.cos(f) + Math.cos(n) * r * Math.sin(f),
            h = t.x + Math.cos(n) * i * Math.cos(u) + Math.sin(-n) * r * Math.sin(u),
            c = t.y + Math.sin(n) * i * Math.cos(u) + Math.cos(n) * r * Math.sin(u),
            l = e > 180 ? 1 : 0,
            a = e > 0 ? 1 : 0;
        return {
            x0: o,
            y0: s,
            tilt: n,
            largeArc: l,
            sweep: a,
            x1: h,
            y1: c
        }
    },
    _getLatRadius: function() {
        return this._mRadiusY / 40075017 * 360
    },
    _getLngRadius: function() {
        return this._mRadiusX / 40075017 * 360 / Math.cos(L.LatLng.DEG_TO_RAD * this._latlng.lat)
    },
    _checkIfEmpty: function() {
        if (!this._map) return !1;
        var n = this._map._pathViewport,
            t = this._radiusX,
            i = this._point;
        return i.x - t > n.max.x || i.y - t > n.max.y || i.x + t < n.min.x || i.y + t < n.min.y
    }
});
L.ellipse = function(n, t, i, r) {
        return new L.Ellipse(n, t, i, r)
    },
    function(n) {
        var t = function() {
            var i = function(n) {
                    var t = {
                        data: [],
                        heatmap: n
                    };
                    this.max = 1;
                    this.get = function(n) {
                        return t[n]
                    };
                    this.set = function(n, i) {
                        t[n] = i
                    }
                },
                n, t;
            return i.prototype = {
                addDataPoint: function(n, t) {
                    if (!(n < 0) && !(t < 0)) {
                        var r = this,
                            u = r.get("heatmap"),
                            i = r.get("data");
                        if (i[n] || (i[n] = []), i[n][t] || (i[n][t] = 0), i[n][t] += arguments.length < 3 ? 1 : arguments[2], r.set("data", i), r.max < i[n][t]) {
                            u.get("actx").clearRect(0, 0, u.get("width"), u.get("height"));
                            r.setDataSet({
                                max: i[n][t],
                                data: i
                            }, !0);
                            return
                        }
                        u.drawAlpha(n, t, i[n][t], !0)
                    }
                },
                setDataSet: function(n, t) {
                    var h = this,
                        r = h.get("heatmap"),
                        f = [],
                        u = n.data,
                        s = u.length,
                        e, o, i;
                    if (r.clear(), this.max = n.max, r.get("legend") && r.get("legend").update(n.max), t != null && t) {
                        for (e in u)
                            if (e !== undefined)
                                for (o in u[e]) o !== undefined && r.drawAlpha(e, o, u[e][o], !1)
                    } else
                        while (s--) i = u[s], r.drawAlpha(i.x, i.y, i.count, !1), f[i.x] || (f[i.x] = []), f[i.x][i.y] || (f[i.x][i.y] = 0), f[i.x][i.y] = i.count;
                    r.colorize();
                    this.set("data", u)
                },
                exportDataSet: function() {
                    var r = this,
                        i = r.get("data"),
                        u = [],
                        n, t;
                    for (n in i)
                        if (n !== undefined)
                            for (t in i[n]) t !== undefined && u.push({
                                x: parseInt(n, 10),
                                y: parseInt(t, 10),
                                count: i[n][t]
                            });
                    return {
                        max: r.max,
                        data: u
                    }
                },
                generateRandomDataSet: function(n) {
                    var r = this.get("heatmap"),
                        f = r.get("width"),
                        e = r.get("height"),
                        t = {},
                        u = Math.floor(Math.random() * 1e3 + 1),
                        i;
                    for (t.max = u, i = []; n--;) i.push({
                        x: Math.floor(Math.random() * f + 1),
                        y: Math.floor(Math.random() * e + 1),
                        count: Math.floor(Math.random() * u + 1)
                    });
                    t.data = i;
                    this.setDataSet(t)
                }
            }, n = function(n) {
                this.config = n;
                var t = {
                    element: null,
                    labelsEl: null,
                    gradientCfg: null,
                    ctx: null
                };
                this.get = function(n) {
                    return t[n]
                };
                this.set = function(n, i) {
                    t[n] = i
                };
                this.init()
            }, n.prototype = {
                init: function() {
                    var n = this,
                        i = n.config,
                        s = i.title || "Legend",
                        o = i.position,
                        r = i.offset || 10,
                        h = i.gradient,
                        u = document.createElement("ul"),
                        t, f, e = "";
                    n.processGradientObject();
                    e += o.indexOf("t") > -1 ? "top:" + r + "px;" : "bottom:" + r + "px;";
                    e += o.indexOf("l") > -1 ? "left:" + r + "px;" : "right:" + r + "px;";
                    t = document.createElement("div");
                    t.style.cssText = "border-radius:5px;position:absolute;" + e + "font-family:Helvetica; width:256px;z-index:10000000000; background:rgba(255,255,255,1);padding:10px;border:1px solid black;margin:0;";
                    t.innerHTML = "<h3 style='padding:0;margin:0;text-align:center;font-size:16px;'>" + s + "<\/h3>";
                    u.style.cssText = "position:relative;font-size:12px;display:block;list-style:none;list-style-type:none;margin:0;height:15px;";
                    f = document.createElement("div");
                    f.style.cssText = ["position:relative;display:block;width:256px;height:15px;border-bottom:1px solid black; background-image:url(", n.createGradientImage(), ");"].join("");
                    t.appendChild(u);
                    t.appendChild(f);
                    n.set("element", t);
                    n.set("labelsEl", u);
                    n.update(1)
                },
                processGradientObject: function() {
                    var r = this,
                        i = this.config.gradient,
                        n = [],
                        t;
                    for (t in i) i.hasOwnProperty(t) && n.push({
                        stop: t,
                        value: i[t]
                    });
                    n.sort(function(n, t) {
                        return n.stop - t.stop
                    });
                    n.unshift({
                        stop: 0,
                        value: "rgba(0,0,0,0)"
                    });
                    r.set("gradientArr", n)
                },
                createGradientImage: function() {
                    var f = this,
                        e = f.get("gradientArr"),
                        i = e.length,
                        r = document.createElement("canvas"),
                        n = r.getContext("2d"),
                        u, t;
                    for (r.width = "256", r.height = "15", u = n.createLinearGradient(0, 5, 256, 10), t = 0; t < i; t++) u.addColorStop(1 / (i - 1) * t, e[t].value);
                    for (n.fillStyle = u, n.fillRect(0, 5, 256, 10), n.strokeStyle = "black", n.beginPath(), t = 0; t < i; t++) n.moveTo((1 / (i - 1) * t * 256 >> 0) + .5, 0), n.lineTo((1 / (i - 1) * t * 256 >> 0) + .5, t == 0 ? 15 : 5);
                    return n.moveTo(255.5, 0), n.lineTo(255.5, 15), n.moveTo(255.5, 4.5), n.lineTo(0, 4.5), n.stroke(), f.set("ctx", n), r.toDataURL()
                },
                getElement: function() {
                    return this.get("element")
                },
                update: function(n) {
                    for (var u = this, i = u.get("gradientArr"), o = u.get("ctx"), s = u.get("labelsEl"), f, e = "", r, t = 0; t < i.length; t++) f = n * i[t].stop >> 0, r = o.measureText(f).width / 2 >> 0, t == 0 && (r = 0), t == i.length - 1 && (r *= 2), e += '<li style="position:absolute;left:' + (((1 / (i.length - 1) * t * 256 || 0) >> 0) - r + .5) + 'px">' + f + "<\/li>";
                    s.innerHTML = e
                }
            }, t = function(n) {
                var t = {
                    radius: 40,
                    element: {},
                    canvas: {},
                    acanvas: {},
                    ctx: {},
                    actx: {},
                    legend: null,
                    visible: !0,
                    width: 0,
                    height: 0,
                    max: !1,
                    gradient: !1,
                    opacity: 180,
                    premultiplyAlpha: !1,
                    bounds: {
                        l: 1e3,
                        r: 0,
                        t: 1e3,
                        b: 0
                    },
                    debug: !1
                };
                this.store = new i(this);
                this.get = function(n) {
                    return t[n]
                };
                this.set = function(n, i) {
                    t[n] = i
                };
                this.configure(n);
                this.init()
            }, t.prototype = {
                configure: function(t) {
                    var i = this,
                        r;
                    i.set("radius", t.radius || 40);
                    i.set("element", t.element instanceof Object ? t.element : document.getElementById(t.element));
                    i.set("visible", t.visible != null ? t.visible : !0);
                    i.set("max", t.max || !1);
                    i.set("gradient", t.gradient || {.45: "rgb(0,0,255)", .55: "rgb(0,255,255)", .65: "rgb(0,255,0)", .95: "yellow", 1: "rgb(255,0,0)"
                    });
                    i.set("opacity", parseInt(255 / (100 / t.opacity), 10) || 180);
                    i.set("width", t.width || 0);
                    i.set("height", t.height || 0);
                    i.set("debug", t.debug);
                    t.legend && (r = t.legend, r.gradient = i.get("gradient"), i.set("legend", new n(r)))
                },
                resize: function() {
                    var n = this,
                        t = n.get("element"),
                        i = n.get("canvas"),
                        r = n.get("acanvas");
                    i.width = r.width = n.get("width") || t.style.width.replace(/px/, "") || n.getWidth(t);
                    this.set("width", i.width);
                    i.height = r.height = n.get("height") || t.style.height.replace(/px/, "") || n.getHeight(t);
                    this.set("height", i.height)
                },
                init: function() {
                    var n = this,
                        t = document.createElement("canvas"),
                        i = document.createElement("canvas"),
                        f = t.getContext("2d"),
                        r = i.getContext("2d"),
                        u = n.get("element");
                    n.initColorPalette();
                    n.set("canvas", t);
                    n.set("ctx", f);
                    n.set("acanvas", i);
                    n.set("actx", r);
                    n.resize();
                    t.style.cssText = i.style.cssText = "position:absolute;top:0;left:0;z-index:10000000;";
                    n.get("visible") || (t.style.display = "none");
                    u.appendChild(t);
                    n.get("legend") && u.appendChild(n.get("legend").getElement());
                    n.get("debug") && document.body.appendChild(i);
                    r.shadowOffsetX = 15e3;
                    r.shadowOffsetY = 15e3;
                    r.shadowBlur = 15
                },
                initColorPalette: function() {
                    var i = this,
                        r = document.createElement("canvas"),
                        e = i.get("gradient"),
                        t, u, n, f;
                    r.width = "1";
                    r.height = "256";
                    t = r.getContext("2d");
                    u = t.createLinearGradient(0, 0, 1, 256);
                    n = t.getImageData(0, 0, 1, 1);
                    n.data[0] = n.data[3] = 64;
                    n.data[1] = n.data[2] = 0;
                    t.putImageData(n, 0, 0);
                    n = t.getImageData(0, 0, 1, 1);
                    i.set("premultiplyAlpha", n.data[0] < 60 || n.data[0] > 70);
                    for (f in e) u.addColorStop(f, e[f]);
                    t.fillStyle = u;
                    t.fillRect(0, 0, 1, 256);
                    i.set("gradient", t.getImageData(0, 0, 1, 256).data)
                },
                getWidth: function(n) {
                    var t = n.offsetWidth;
                    return n.style.paddingLeft && (t += n.style.paddingLeft), n.style.paddingRight && (t += n.style.paddingRight), t
                },
                getHeight: function(n) {
                    var t = n.offsetHeight;
                    return n.style.paddingTop && (t += n.style.paddingTop), n.style.paddingBottom && (t += n.style.paddingBottom), t
                },
                colorize: function(n, t) {
                    var u = this,
                        l = u.get("width"),
                        g = u.get("radius"),
                        a = u.get("height"),
                        nt = u.get("actx"),
                        tt = u.get("ctx"),
                        e = g * 3,
                        it = u.get("premultiplyAlpha"),
                        p = u.get("gradient"),
                        k = u.get("opacity"),
                        f = u.get("bounds"),
                        o, s, w, b, v, i, d, y, h, c, r;
                    for (n != null && t != null ? (n + e > l && (n = l - e), n < 0 && (n = 0), t < 0 && (t = 0), t + e > a && (t = a - e), o = n, s = t, b = n + e, w = t + e) : (o = f.l < 0 ? 0 : f.l, b = f.r > l ? l : f.r, s = f.t < 0 ? 0 : f.t, w = f.b > a ? a : f.b), v = nt.getImageData(o, s, b - o, w - s), i = v.data, d = i.length, r = 3; r < d; r += 4)(y = i[r], h = y * 4, h) && (c = y < k ? y : k, i[r - 3] = p[h], i[r - 2] = p[h + 1], i[r - 1] = p[h + 2], it && (i[r - 3] /= 255 / c, i[r - 2] /= 255 / c, i[r - 1] /= 255 / c), i[r] = c);
                    v.data = i;
                    tt.putImageData(v, o, s)
                },
                drawAlpha: function(n, t, i, r) {
                    var e = this,
                        o = e.get("radius"),
                        u = e.get("actx"),
                        a = e.get("max"),
                        f = e.get("bounds"),
                        s = n - 1.5 * o >> 0,
                        h = t - 1.5 * o >> 0,
                        c = n + 1.5 * o >> 0,
                        l = t + 1.5 * o >> 0;
                    u.shadowColor = "rgba(0,0,0," + (i ? i / e.store.max : "0.1") + ")";
                    u.shadowOffsetX = 15e3;
                    u.shadowOffsetY = 15e3;
                    u.shadowBlur = 15;
                    u.beginPath();
                    u.arc(n - 15e3, t - 15e3, o, 0, Math.PI * 2, !0);
                    u.closePath();
                    u.fill();
                    r ? e.colorize(s, h) : (s < f.l && (f.l = s), h < f.t && (f.t = h), c > f.r && (f.r = c), l > f.b && (f.b = l))
                },
                toggleDisplay: function() {
                    var n = this,
                        t = n.get("visible"),
                        i = n.get("canvas");
                    i.style.display = t ? "none" : "block";
                    n.set("visible", !t)
                },
                getImageData: function() {
                    return this.get("canvas").toDataURL()
                },
                clear: function() {
                    var n = this,
                        t = n.get("width"),
                        i = n.get("height");
                    n.store.set("data", []);
                    n.get("ctx").clearRect(0, 0, t, i);
                    n.get("actx").clearRect(0, 0, t, i)
                },
                cleanup: function() {
                    var n = this;
                    n.get("element").removeChild(n.get("canvas"))
                }
            }, {
                create: function(n) {
                    return new t(n)
                },
                util: {
                    mousePosition: function(n) {
                        var t, i;
                        if (n.layerX ? (t = n.layerX, i = n.layerY) : n.offsetX && (t = n.offsetX, i = n.offsetY), typeof t != "undefined") return [t, i]
                    }
                }
            }
        }();
        n.h337 = n.heatmapFactory = t
    }(window);
L.TileLayer.HeatMap = L.TileLayer.Canvas.extend({
    options: {
        maxPerView: !1,
        debug: !1
    },
    initialize: function(n) {
        L.Util.setOptions(this, n);
        this._cache = {
            max: 0,
            bounds: {}
        };
        this._data = [];
        this.drawTile = function(n, t, i) {
            var r = {
                tile: n,
                tilePoint: t,
                zoom: i,
                heatmap: n.heatmap
            };
            this.options.debug && this._drawDebugInfo(r);
            this._draw(r)
        }
    },
    addData: function(n) {
        this._data = n;
        this._cache.max = this._calculateMaxValue(n)
    },
    _createTileProto: function() {
        var n = this._tileProto = L.DomUtil.create("div", "leaflet-tile"),
            t = this.options.tileSize;
        n.style.width = t + "px";
        n.style.height = t + "px";
        n.width = t;
        n.height = t
    },
    _createTile: function() {
        var n = this._tileProto.cloneNode(!1),
            t, i;
        return n.onselectstart = n.onmousemove = L.Util.falseFn, t = this.options, i = {
            radius: t.radius,
            element: n,
            visible: !0,
            opacity: t.opacity * 100,
            gradient: t.gradient
        }, n.heatmap = h337.create(i), n
    },
    _drawDebugInfo: function(n) {
        var r = L.DomUtil.create("canvas", "leaflet-tile-debug"),
            u = this.options.tileSize,
            t, i;
        r.width = u;
        r.height = u;
        n.tile.appendChild(r);
        n.canvas = r;
        t = u;
        i = n.canvas.getContext("2d");
        i.strokeStyle = "#000000";
        i.fillStyle = "#FFFF00";
        i.strokeRect(0, 0, t, t);
        i.font = "12px Arial";
        i.fillRect(0, 0, 5, 5);
        i.fillRect(0, t - 5, 5, 5);
        i.fillRect(t - 5, 0, 5, 5);
        i.fillRect(t - 5, t - 5, 5, 5);
        i.fillRect(t / 2 - 5, t / 2 - 5, 10, 10);
        i.strokeText(n.tilePoint.x + " " + n.tilePoint.y + " " + n.zoom, t / 2 - 30, t / 2 - 10);
        this._drawPoint(n, [0, 0])
    },
    _drawPoint: function(n, t) {
        var r = this._tilePoint(n, t),
            u = n.canvas,
            i = u.getContext("2d");
        i.beginPath();
        i.fillStyle = "#FF0000";
        i.arc(r.x, r.y, 4, 0, Math.PI * 2);
        i.closePath();
        i.fill();
        i.restore()
    },
    _tilePoint: function(n, t) {
        var i = n.tilePoint.multiplyBy(this.options.tileSize),
            r = this._map.project(new L.LatLng(t[1], t[0])),
            u = Math.round(r.x - i.x),
            f = Math.round(r.y - i.y);
        return {
            x: u,
            y: f
        }
    },
    _isInTile: function(n, t) {
        var i;
        if (t = t || this.options.radius, i = this._cache.bounds[t], !i) {
            var r = this.options.tileSize,
                u = new L.Point(-t, -t),
                f = new L.Point(t + r, t + r);
            i = this._cache.bounds[t] = new L.Bounds(u, f)
        }
        return i.contains([n.x, n.y])
    },
    _getMaxValue: function() {
        if (this.options.maxPerView) {
            var n = [],
                t = this._map.getBounds();
            return this._data.forEach(function(i) {
                t.contains([i.lat, i.lon]) && n.push(i)
            }), this._calculateMaxValue(n)
        }
        return this._cache.max
    },
    _calculateMaxValue: function(n) {
        return array = [], n.forEach(function(n) {
            array.push(n.value || n.count)
        }), Math.max.apply(Math, array)
    },
    _draw: function(n) {
        var u = n.heatmap,
            r, t, f, e, i;
        if (u.clear(), r = [], this._data.length > 0)
            for (t = 0, f = this._data.length; t < f; t++) e = [this._data[t].lon, this._data[t].lat], i = this._tilePoint(n, e), this._isInTile(i) && r.push({
                x: i.x,
                y: i.y,
                count: this._data[t].value
            });
        return u.store.setDataSet({
            max: this._getMaxValue(),
            data: r
        }), this
    },
    tileDrawn: function(n) {
        this._tileOnLoad.call(n)
    }
});
L.TileLayer.heatMap = function(n) {
        return new L.TileLayer.HeatMap(n)
    },
    function() {
        var f, e, r, n, u, o, t, s, h, i, c = [].indexOf || function(n) {
            for (var t = 0, i = this.length; t < i; t++)
                if (t in this && this[t] === n) return t;
            return -1
        };
        s = function() {
            var n, r, t, i;
            if (window.WebGLRenderingContext != null) return i = ["WEBKIT", "MOZ", "MS", "O"], t = /^WEBKIT_(.*)|MOZ_(.*)|MS_(.*)|O_(.*)/, n = WebGLRenderingContext.prototype.getExtension, WebGLRenderingContext.prototype.getExtension = function(r) {
                var u, e, o, f, s;
                if (e = r.match(t), e !== null && (r = e[1]), u = n.call(this, r), u === null) {
                    for (f = 0, s = i.length; f < s; f++)
                        if (o = i[f], u = n.call(this, o + "_" + r), u !== null) return u;
                    return null
                }
                return u
            }, r = WebGLRenderingContext.prototype.getSupportedExtensions, WebGLRenderingContext.prototype.getSupportedExtensions = function() {
                var n, f, i, e, u, o;
                for (e = r.call(this), i = [], u = 0, o = e.length; u < o; u++) n = e[u], f = n.match(t), f !== null && (n = f[1]), c.call(i, n) < 0 && i.push(n);
                return i
            }
        };
        h = function() {
            var r, u, l, f, h, a, v, e, n, i, t, o, s, y;
            if (h = function() {
                    var n, t, i;
                    return n = document.createElement("canvas"), n.width = 2, n.height = 2, t = n.getContext("2d"), i = t.getImageData(0, 0, 2, 2), i.data.set(new Uint8ClampedArray([0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 255, 255, 255, 255])), t.putImageData(i, 0, 0), n
                }, h(), u = function(n, t) {
                    var e, a, r, o, s, i, c, v, l, y, p, f, u, w;
                    if (i = n.createProgram(), u = n.createShader(n.VERTEX_SHADER), n.attachShader(i, u), n.shaderSource(u, "attribute vec2 position;\nvoid main(){\n    gl_Position = vec4(position, 0.0, 1.0);\n}"), n.compileShader(u), !n.getShaderParameter(u, n.COMPILE_STATUS)) throw n.getShaderInfoLog(u);
                    if (r = n.createShader(n.FRAGMENT_SHADER), n.attachShader(i, r), n.shaderSource(r, "uniform sampler2D source;\nvoid main(){\n    gl_FragColor = texture2D(source, vec2(1.0, 1.0));\n}"), n.compileShader(r), !n.getShaderParameter(r, n.COMPILE_STATUS)) throw n.getShaderInfoLog(r);
                    if (n.linkProgram(i), !n.getProgramParameter(i, n.LINK_STATUS)) throw n.getProgramInfoLog(i);
                    return n.useProgram(i), a = function() {
                        return n.deleteShader(r), n.deleteShader(u), n.deleteProgram(i), n.deleteBuffer(e), n.deleteTexture(l), n.deleteTexture(f), n.deleteFramebuffer(o), n.bindBuffer(n.ARRAY_BUFFER, null), n.useProgram(null), n.bindTexture(n.TEXTURE_2D, null), n.bindFramebuffer(n.FRAMEBUFFER, null)
                    }, f = n.createTexture(), n.bindTexture(n.TEXTURE_2D, f), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, 2, 2, 0, n.RGBA, n.UNSIGNED_BYTE, null), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), o = n.createFramebuffer(), n.bindFramebuffer(n.FRAMEBUFFER, o), n.framebufferTexture2D(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, f, 0), y = h(), l = n.createTexture(), n.bindTexture(n.TEXTURE_2D, l), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, n.RGBA, t, y), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MAG_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), w = new Float32Array([1, 1, -1, 1, -1, -1, 1, 1, -1, -1, 1, -1]), e = n.createBuffer(), n.bindBuffer(n.ARRAY_BUFFER, e), n.bufferData(n.ARRAY_BUFFER, w, n.STATIC_DRAW), s = n.getAttribLocation(i, "position"), p = n.getUniformLocation(i, "source"), n.enableVertexAttribArray(s), n.vertexAttribPointer(s, 2, n.FLOAT, !1, 0, 0), n.uniform1i(p, 0), n.drawArrays(n.TRIANGLES, 0, 6), c = new Uint8Array(16), n.readPixels(0, 0, 2, 2, n.RGBA, n.UNSIGNED_BYTE, c), v = Math.abs(c[0] - 127) < 10, a(), v
                }, f = function(n, t) {
                    var i;
                    return i = n.createTexture(), n.bindTexture(n.TEXTURE_2D, i), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, 2, 2, 0, n.RGBA, t, null), n.getError() === 0 ? (n.deleteTexture(i), !0) : (n.deleteTexture(i), !1)
                }, r = function(n, t) {
                    var u, r, i;
                    return i = n.createTexture(), n.bindTexture(n.TEXTURE_2D, i), n.texImage2D(n.TEXTURE_2D, 0, n.RGBA, 2, 2, 0, n.RGBA, t, null), r = n.createFramebuffer(), n.bindFramebuffer(n.FRAMEBUFFER, r), n.framebufferTexture2D(n.FRAMEBUFFER, n.COLOR_ATTACHMENT0, n.TEXTURE_2D, i, 0), u = n.checkFramebufferStatus(n.FRAMEBUFFER), n.deleteTexture(i), n.deleteFramebuffer(r), n.bindTexture(n.TEXTURE_2D, null), n.bindFramebuffer(n.FRAMEBUFFER, null), u === n.FRAMEBUFFER_COMPLETE ? !0 : !1
                }, n = [], i = {}, t = [], l = function() {
                    var l, o, e, s, h, a, c;
                    l = document.createElement("canvas");
                    e = null;
                    try {
                        e = l.getContext("experimental-webgl");
                        e === null && (e = l.getContext("webgl"))
                    } catch (v) {}
                    if (e != null && (a = e.getExtension("OES_texture_float"), a === null ? f(e, e.FLOAT) ? (c = !0, n.push("OES_texture_float"), i.OES_texture_float = {
                            shim: !0
                        }) : (c = !1, t.push("OES_texture_float")) : f(e, e.FLOAT) ? (c = !0, n.push("OES_texture_float")) : (c = !1, t.push("OES_texture_float")), c && (o = e.getExtension("WEBGL_color_buffer_float"), o === null ? r(e, e.FLOAT) ? (n.push("WEBGL_color_buffer_float"), i.WEBGL_color_buffer_float = {
                            shim: !0,
                            RGBA32F_EXT: 34836,
                            RGB32F_EXT: 34837,
                            FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 33297,
                            UNSIGNED_NORMALIZED_EXT: 35863
                        }) : t.push("WEBGL_color_buffer_float") : r(e, e.FLOAT) ? n.push("WEBGL_color_buffer_float") : t.push("WEBGL_color_buffer_float"), o = e.getExtension("OES_texture_float_linear"), o === null ? u(e, e.FLOAT) ? (n.push("OES_texture_float_linear"), i.OES_texture_float_linear = {
                            shim: !0
                        }) : t.push("OES_texture_float_linear") : u(e, e.FLOAT) ? n.push("OES_texture_float_linear") : t.push("OES_texture_float_linear")), s = e.getExtension("OES_texture_half_float"), s === null ? f(e, 36193) ? (h = !0, n.push("OES_texture_half_float"), s = i.OES_texture_half_float = {
                            HALF_FLOAT_OES: 36193,
                            shim: !0
                        }) : (h = !1, t.push("OES_texture_half_float")) : f(e, s.HALF_FLOAT_OES) ? (h = !0, n.push("OES_texture_half_float")) : (h = !1, t.push("OES_texture_half_float")), h)) return o = e.getExtension("EXT_color_buffer_half_float"), o === null ? r(e, s.HALF_FLOAT_OES) ? (n.push("EXT_color_buffer_half_float"), i.EXT_color_buffer_half_float = {
                        shim: !0,
                        RGBA16F_EXT: 34842,
                        RGB16F_EXT: 34843,
                        FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: 33297,
                        UNSIGNED_NORMALIZED_EXT: 35863
                    }) : t.push("EXT_color_buffer_half_float") : r(e, s.HALF_FLOAT_OES) ? n.push("EXT_color_buffer_half_float") : t.push("EXT_color_buffer_half_float"), o = e.getExtension("OES_texture_half_float_linear"), o === null ? u(e, s.HALF_FLOAT_OES) ? (n.push("OES_texture_half_float_linear"), i.OES_texture_half_float_linear = {
                        shim: !0
                    }) : t.push("OES_texture_half_float_linear") : u(e, s.HALF_FLOAT_OES) ? n.push("OES_texture_half_float_linear") : t.push("OES_texture_half_float_linear")
                }, window.WebGLRenderingContext != null) {
                for (l(), o = {}, s = 0, y = t.length; s < y; s++) e = t[s], o[e] = !0;
                return a = WebGLRenderingContext.prototype.getExtension, WebGLRenderingContext.prototype.getExtension = function(n) {
                    var t;
                    return t = i[n], t === void 0 ? o[n] ? null : a.call(this, n) : t
                }, v = WebGLRenderingContext.prototype.getSupportedExtensions, WebGLRenderingContext.prototype.getSupportedExtensions = function() {
                    var t, i, f, r, u, e, s;
                    for (f = v.call(this), i = [], r = 0, e = f.length; r < e; r++) t = f[r], o[t] === void 0 && i.push(t);
                    for (u = 0, s = n.length; u < s; u++) t = n[u], c.call(i, t) < 0 && i.push(t);
                    return i
                }, WebGLRenderingContext.prototype.getFloatExtension = function(n) {
                    var i, r, c, w, b, u, f, k, d, t, l, g, nt, tt, a, o, s, h, it, rt, ut, ft, v, ot, st, ht, et, y, p;
                    for ((ot = n.prefer) == null && (n.prefer = ["half"]), (st = n.require) == null && (n.require = []), (ht = n.throws) == null && (n.throws = !0), tt = this.getExtension("OES_texture_float"), u = this.getExtension("OES_texture_half_float"), g = this.getExtension("WEBGL_color_buffer_float"), w = this.getExtension("EXT_color_buffer_half_float"), nt = this.getExtension("OES_texture_float_linear"), b = this.getExtension("OES_texture_half_float_linear"), l = {
                            texture: tt !== null,
                            filterable: nt !== null,
                            renderable: g !== null,
                            score: 0,
                            precision: "single",
                            half: !1,
                            single: !0,
                            type: this.FLOAT
                        }, c = {
                            texture: u !== null,
                            filterable: b !== null,
                            renderable: w !== null,
                            score: 0,
                            precision: "half",
                            half: !0,
                            single: !1,
                            type: (et = u != null ? u.HALF_FLOAT_OES : void 0) != null ? et : null
                        }, r = [], l.texture && r.push(l), c.texture && r.push(c), t = [], o = 0, it = r.length; o < it; o++) {
                        for (i = r[o], a = !0, y = n.require, s = 0, rt = y.length; s < rt; s++) e = y[s], i[e] === !1 && (a = !1);
                        a && t.push(i)
                    }
                    for (h = 0, ut = t.length; h < ut; h++)
                        for (i = t[h], p = n.prefer, f = v = 0, ft = p.length; v < ft; f = ++v) d = p[f], k = Math.pow(2, n.prefer.length - f - 1), i[d] && (i.score += k);
                    if (t.sort(function(n, t) {
                            return n.score === t.score ? 0 : n.score < t.score ? 1 : n.score > t.score ? -1 : void 0
                        }), t.length === 0)
                        if (n.throws) throw "No floating point texture support that is " + n.require.join(", ");
                        else return null;
                    else return t = t[0], {
                        filterable: t.filterable,
                        renderable: t.renderable,
                        type: t.type,
                        precision: t.precision
                    }
                }
            }
        };
        s();
        h();
        n = function() {
            function n(n, t) {
                var i, r;
                this.gl = n;
                r = t.vertex;
                i = t.fragment;
                this.program = this.gl.createProgram();
                this.vs = this.gl.createShader(this.gl.VERTEX_SHADER);
                this.fs = this.gl.createShader(this.gl.FRAGMENT_SHADER);
                this.gl.attachShader(this.program, this.vs);
                this.gl.attachShader(this.program, this.fs);
                this.compileShader(this.vs, r);
                this.compileShader(this.fs, i);
                this.link();
                this.value_cache = {};
                this.uniform_cache = {};
                this.attribCache = {}
            }
            return n.prototype.attribLocation = function(n) {
                var t;
                return t = this.attribCache[n], t === void 0 && (t = this.attribCache[n] = this.gl.getAttribLocation(this.program, n)), t
            }, n.prototype.compileShader = function(n, t) {
                if (this.gl.shaderSource(n, t), this.gl.compileShader(n), !this.gl.getShaderParameter(n, this.gl.COMPILE_STATUS)) throw "Shader Compile Error: " + this.gl.getShaderInfoLog(n);
            }, n.prototype.link = function() {
                if (this.gl.linkProgram(this.program), !this.gl.getProgramParameter(this.program, this.gl.LINK_STATUS)) throw "Shader Link Error: " + this.gl.getProgramInfoLog(this.program);
            }, n.prototype.use = function() {
                return this.gl.useProgram(this.program), this
            }, n.prototype.uniformLoc = function(n) {
                var t;
                return t = this.uniform_cache[n], t === void 0 && (t = this.uniform_cache[n] = this.gl.getUniformLocation(this.program, n)), t
            }, n.prototype.int = function(n, t) {
                var r, i;
                return r = this.value_cache[n], r !== t && (this.value_cache[n] = t, i = this.uniformLoc(n), i && this.gl.uniform1i(i, t)), this
            }, n.prototype.vec2 = function(n, t, i) {
                var r;
                return r = this.uniformLoc(n), r && this.gl.uniform2f(r, t, i), this
            }, n.prototype.float = function(n, t) {
                var r, i;
                return r = this.value_cache[n], r !== t && (this.value_cache[n] = t, i = this.uniformLoc(n), i && this.gl.uniform1f(i, t)), this
            }, n
        }();
        f = function() {
            function n(n) {
                this.gl = n;
                this.buffer = this.gl.createFramebuffer()
            }
            return n.prototype.destroy = function() {
                return this.gl.deleteFRamebuffer(this.buffer)
            }, n.prototype.bind = function() {
                return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, this.buffer), this
            }, n.prototype.unbind = function() {
                return this.gl.bindFramebuffer(this.gl.FRAMEBUFFER, null), this
            }, n.prototype.check = function() {
                var n = this.gl.checkFramebufferStatus(this.gl.FRAMEBUFFER);
                switch (n) {
                    case this.gl.FRAMEBUFFER_UNSUPPORTED:
                        throw "Framebuffer is unsupported";
                    case this.gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
                        throw "Framebuffer incomplete attachment";
                    case this.gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
                        throw "Framebuffer incomplete dimensions";
                    case this.gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
                        throw "Framebuffer incomplete missing attachment";
                }
                return this
            }, n.prototype.color = function(n) {
                return this.gl.framebufferTexture2D(this.gl.FRAMEBUFFER, this.gl.COLOR_ATTACHMENT0, n.target, n.handle, 0), this.check(), this
            }, n.prototype.depth = function(n) {
                return this.gl.framebufferRenderbuffer(this.gl.FRAMEBUFFER, this.gl.DEPTH_ATTACHMENT, this.gl.RENDERBUFFER, n.id), this.check(), this
            }, n.prototype.destroy = function() {
                return this.gl.deleteFramebuffer(this.buffer)
            }, n
        }();
        u = function() {
            function n(n, t) {
                var i, r;
                this.gl = n;
                t == null && (t = {});
                this.channels = this.gl[((i = t.channels) != null ? i : "rgba").toUpperCase()];
                this.type = typeof t.type == "number" ? t.type : this.gl[((r = t.type) != null ? r : "unsigned_byte").toUpperCase()];
                switch (this.channels) {
                    case this.gl.RGBA:
                        this.chancount = 4;
                        break;
                    case this.gl.RGB:
                        this.chancount = 3;
                        break;
                    case this.gl.LUMINANCE_ALPHA:
                        this.chancount = 2;
                        break;
                    default:
                        this.chancount = 1
                }
                this.target = this.gl.TEXTURE_2D;
                this.handle = this.gl.createTexture()
            }
            return n.prototype.destroy = function() {
                return this.gl.deleteTexture(this.handle)
            }, n.prototype.bind = function(n) {
                if (n == null && (n = 0), n > 15) throw "Texture unit too large: " + n;
                return this.gl.activeTexture(this.gl.TEXTURE0 + n), this.gl.bindTexture(this.target, this.handle), this
            }, n.prototype.setSize = function(n, t) {
                return this.width = n, this.height = t, this.gl.texImage2D(this.target, 0, this.channels, this.width, this.height, 0, this.channels, this.type, null), this
            }, n.prototype.upload = function(n) {
                return this.width = n.width, this.height = n.height, this.gl.texImage2D(this.target, 0, this.channels, this.channels, this.type, n), this
            }, n.prototype.linear = function() {
                return this.gl.texParameteri(this.target, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR), this.gl.texParameteri(this.target, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR), this
            }, n.prototype.nearest = function() {
                return this.gl.texParameteri(this.target, this.gl.TEXTURE_MAG_FILTER, this.gl.NEAREST), this.gl.texParameteri(this.target, this.gl.TEXTURE_MIN_FILTER, this.gl.NEAREST), this
            }, n.prototype.clampToEdge = function() {
                return this.gl.texParameteri(this.target, this.gl.TEXTURE_WRAP_S, this.gl.CLAMP_TO_EDGE), this.gl.texParameteri(this.target, this.gl.TEXTURE_WRAP_T, this.gl.CLAMP_TO_EDGE), this
            }, n.prototype.repeat = function() {
                return this.gl.texParameteri(this.target, this.gl.TEXTURE_WRAP_S, this.gl.REPEAT), this.gl.texParameteri(this.target, this.gl.TEXTURE_WRAP_T, this.gl.REPEAT), this
            }, n
        }();
        r = function() {
            function n(n, t, i) {
                var r;
                this.gl = n;
                this.width = t;
                this.height = i;
                r = this.gl.getFloatExtension({
                    require: ["renderable"]
                });
                this.texture = new u(this.gl, {
                    type: r.type
                }).bind(0).setSize(this.width, this.height).nearest().clampToEdge();
                this.fbo = new f(this.gl).bind().color(this.texture).unbind()
            }
            return n.prototype.use = function() {
                return this.fbo.bind()
            }, n.prototype.bind = function(n) {
                return this.texture.bind(n)
            }, n.prototype.end = function() {
                return this.fbo.unbind()
            }, n.prototype.resize = function(n, t) {
                return this.width = n, this.height = t, this.texture.bind(0).setSize(this.width, this.height)
            }, n
        }();
        i = "attribute vec4 position;\nvarying vec2 texcoord;\nvoid main(){\n    texcoord = position.xy*0.5+0.5;\n    gl_Position = position;\n}";
        t = "#ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp int;\n    precision highp float;\n#else\n    precision mediump int;\n    precision mediump float;\n#endif\nuniform sampler2D source;\nvarying vec2 texcoord;";
        e = function() {
            function u(u, f, e, o) {
                var c, s, h;
                for (this.heatmap = u, this.gl = f, this.width = e, this.height = o, this.shader = new n(this.gl, {
                        vertex: "attribute vec4 position, intensity;\nvarying vec2 off, dim;\nvarying float vIntensity;\nuniform vec2 viewport;\n\nvoid main(){\n    dim = abs(position.zw);\n    off = position.zw;\n    vec2 pos = position.xy + position.zw;\n    vIntensity = intensity.x;\n    gl_Position = vec4((pos/viewport)*2.0-1.0, 0.0, 1.0);\n}",
                        fragment: "#ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp int;\n    precision highp float;\n#else\n    precision mediump int;\n    precision mediump float;\n#endif\nvarying vec2 off, dim;\nvarying float vIntensity;\nvoid main(){\n    float falloff = (1.0 - smoothstep(0.0, 1.0, length(off/dim)));\n    float intensity = falloff*vIntensity;\n    gl_FragColor = vec4(intensity);\n}"
                    }), this.clampShader = new n(this.gl, {
                        vertex: i,
                        fragment: t + "uniform float low, high;\nvoid main(){\n    gl_FragColor = vec4(clamp(texture2D(source, texcoord).rgb, low, high), 1.0);\n}"
                    }), this.multiplyShader = new n(this.gl, {
                        vertex: i,
                        fragment: t + "uniform float value;\nvoid main(){\n    gl_FragColor = vec4(texture2D(source, texcoord).rgb*value, 1.0);\n}"
                    }), this.blurShader = new n(this.gl, {
                        vertex: i,
                        fragment: t + "uniform vec2 viewport;\nvoid main(){\n    vec4 result = vec4(0.0);\n    for(int x=-1; x<=1; x++){\n        for(int y=-1; y<=1; y++){\n            vec2 off = vec2(x,y)/viewport;\n            //float factor = 1.0 - smoothstep(0.0, 1.5, length(off));\n            float factor = 1.0;\n            result += vec4(texture2D(source, texcoord+off).rgb*factor, factor);\n        }\n    }\n    gl_FragColor = vec4(result.rgb/result.w, 1.0);\n}"
                    }), this.nodeBack = new r(this.gl, this.width, this.height), this.nodeFront = new r(this.gl, this.width, this.height), this.vertexBuffer = this.gl.createBuffer(), this.vertexSize = 8, this.maxPointCount = 10240, this.vertexBufferData = new Float32Array(this.maxPointCount * this.vertexSize * 6), this.vertexBufferViews = [], c = s = 0, h = this.maxPointCount; 0 <= h ? s < h : s > h; c = 0 <= h ? ++s : --s) this.vertexBufferViews.push(new Float32Array(this.vertexBufferData.buffer, 0, c * this.vertexSize * 6));
                this.bufferIndex = 0;
                this.pointCount = 0
            }
            return u.prototype.resize = function(n, t) {
                return this.width = n, this.height = t, this.nodeBack.resize(this.width, this.height), this.nodeFront.resize(this.width, this.height)
            }, u.prototype.update = function() {
                var n, t;
                if (this.pointCount > 0) return this.gl.enable(this.gl.BLEND), this.nodeFront.use(), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.vertexBuffer), this.gl.bufferData(this.gl.ARRAY_BUFFER, this.vertexBufferViews[this.pointCount], this.gl.STREAM_DRAW), t = this.shader.attribLocation("position"), n = this.shader.attribLocation("intensity"), this.gl.enableVertexAttribArray(1), this.gl.vertexAttribPointer(t, 4, this.gl.FLOAT, !1, 32, 0), this.gl.vertexAttribPointer(n, 4, this.gl.FLOAT, !1, 32, 16), this.shader.use().vec2("viewport", this.width, this.height), this.gl.drawArrays(this.gl.TRIANGLES, 0, this.pointCount * 6), this.gl.disableVertexAttribArray(1), this.pointCount = 0, this.bufferIndex = 0, this.nodeFront.end(), this.gl.disable(this.gl.BLEND)
            }, u.prototype.clear = function() {
                return this.nodeFront.use(), this.gl.clearColor(0, 0, 0, 1), this.gl.clear(this.gl.COLOR_BUFFER_BIT), this.nodeFront.end()
            }, u.prototype.clamp = function(n, t) {
                return this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.heatmap.quad), this.gl.vertexAttribPointer(0, 4, this.gl.FLOAT, !1, 0, 0), this.nodeFront.bind(0), this.nodeBack.use(), this.clampShader.use().int("source", 0).float("low", n).float("high", t), this.gl.drawArrays(this.gl.TRIANGLES, 0, 6), this.nodeBack.end(), this.swap()
            }, u.prototype.multiply = function(n) {
                return this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.heatmap.quad), this.gl.vertexAttribPointer(0, 4, this.gl.FLOAT, !1, 0, 0), this.nodeFront.bind(0), this.nodeBack.use(), this.multiplyShader.use().int("source", 0).float("value", n), this.gl.drawArrays(this.gl.TRIANGLES, 0, 6), this.nodeBack.end(), this.swap()
            }, u.prototype.blur = function() {
                return this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.heatmap.quad), this.gl.vertexAttribPointer(0, 4, this.gl.FLOAT, !1, 0, 0), this.nodeFront.bind(0), this.nodeBack.use(), this.blurShader.use().int("source", 0).vec2("viewport", this.width, this.height), this.gl.drawArrays(this.gl.TRIANGLES, 0, 6), this.nodeBack.end(), this.swap()
            }, u.prototype.swap = function() {
                var n;
                return n = this.nodeFront, this.nodeFront = this.nodeBack, this.nodeBack = n
            }, u.prototype.addVertex = function(n, t, i, r, u) {
                return this.vertexBufferData[this.bufferIndex++] = n, this.vertexBufferData[this.bufferIndex++] = t, this.vertexBufferData[this.bufferIndex++] = i, this.vertexBufferData[this.bufferIndex++] = r, this.vertexBufferData[this.bufferIndex++] = u, this.vertexBufferData[this.bufferIndex++] = u, this.vertexBufferData[this.bufferIndex++] = u, this.vertexBufferData[this.bufferIndex++] = u
            }, u.prototype.addPoint = function(n, t, i, r) {
                var u;
                return i == null && (i = 50), r == null && (r = .2), this.pointCount >= this.maxPointCount - 1 && this.update(), t = this.height - t, u = i / 2, this.addVertex(n, t, -u, -u, r), this.addVertex(n, t, +u, -u, r), this.addVertex(n, t, -u, +u, r), this.addVertex(n, t, -u, +u, r), this.addVertex(n, t, +u, -u, r), this.addVertex(n, t, +u, +u, r), this.pointCount += 1
            }, u
        }();
        o = function() {
            function r(r) {
                var p, l, w, a, f, h, c, v, b, s, o, y, k, d;
                o = r != null ? r : {};
                this.canvas = o.canvas;
                this.width = o.width;
                this.height = o.height;
                c = o.intensityToAlpha;
                f = o.gradientTexture;
                l = o.alphaRange;
                this.canvas || (this.canvas = document.createElement("canvas"));
                try {
                    if (this.gl = this.canvas.getContext("experimental-webgl", {
                            depth: !1,
                            antialias: !1
                        }), this.gl === null && (this.gl = this.canvas.getContext("webgl", {
                            depth: !1,
                            antialias: !1
                        }), this.gl === null)) throw "WebGL not supported";
                } catch (g) {
                    throw "WebGL not supported";
                }
                window.WebGLDebugUtils != null && (console.log("debugging mode"), this.gl = WebGLDebugUtils.makeDebugContext(this.gl, function(n, t) {
                    throw WebGLDebugUtils.glEnumToString(n) + " was caused by call to: " + t;
                }));
                this.gl.enableVertexAttribArray(0);
                this.gl.blendFunc(this.gl.ONE, this.gl.ONE);
                f ? (s = this.gradientTexture = new u(this.gl, {
                    channels: "rgba"
                }).bind(0).setSize(2, 2).nearest().clampToEdge(), typeof f == "string" ? (h = new Image, h.onload = function() {
                    return s.bind().upload(h)
                }, h.src = f) : f.width > 0 && f.height > 0 ? s.upload(f) : f.onload = function() {
                    return s.upload(f)
                }, a = "uniform sampler2D gradientTexture;\nvec3 getColor(float intensity){\n    return texture2D(gradientTexture, vec2(intensity, 0.0)).rgb;\n}") : (s = null, a = "vec3 getColor(float intensity){\n    vec3 blue = vec3(0.0, 0.0, 1.0);\n    vec3 cyan = vec3(0.0, 1.0, 1.0);\n    vec3 green = vec3(0.0, 1.0, 0.0);\n    vec3 yellow = vec3(1.0, 1.0, 0.0);\n    vec3 red = vec3(1.0, 0.0, 0.0);\n\n    vec3 color = (\n        fade(-0.25, 0.25, intensity)*blue +\n        fade(0.0, 0.5, intensity)*cyan +\n        fade(0.25, 0.75, intensity)*green +\n        fade(0.5, 1.0, intensity)*yellow +\n        smoothstep(0.75, 1.0, intensity)*red\n    );\n    return color;\n}");
                c == null && (c = !0);
                c ? (y = l != null ? l : [0, 1], w = y[0], p = y[1], v = "vec4 alphaFun(vec3 color, float intensity){\n    float alpha = smoothstep(" + w.toFixed(8) + ", " + p.toFixed(8) + ", intensity);\n    return vec4(color*alpha, alpha);\n}") : v = "vec4 alphaFun(vec3 color, float intensity){\n    return vec4(color, 1.0);\n}";
                this.shader = new n(this.gl, {
                    vertex: i,
                    fragment: t + ("float linstep(float low, float high, float value){\n    return clamp((value-low)/(high-low), 0.0, 1.0);\n}\n\nfloat fade(float low, float high, float value){\n    float mid = (low+high)*0.5;\n    float range = (high-low)*0.5;\n    float x = 1.0 - clamp(abs(mid-value)/range, 0.0, 1.0);\n    return smoothstep(0.0, 1.0, x);\n}\n\n" + a + "\n" + v + "\n\nvoid main(){\n    float intensity = smoothstep(0.0, 1.0, texture2D(source, texcoord).r);\n    vec3 color = getColor(intensity);\n    gl_FragColor = alphaFun(color, intensity);\n}")
                });
                (k = this.width) == null && (this.width = this.canvas.offsetWidth || 2);
                (d = this.height) == null && (this.height = this.canvas.offsetHeight || 2);
                this.canvas.width = this.width;
                this.canvas.height = this.height;
                this.gl.viewport(0, 0, this.width, this.height);
                this.quad = this.gl.createBuffer();
                this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.quad);
                b = new Float32Array([-1, -1, 0, 1, 1, -1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, 1, -1, 0, 1, 1, 1, 0, 1]);
                this.gl.bufferData(this.gl.ARRAY_BUFFER, b, this.gl.STATIC_DRAW);
                this.gl.bindBuffer(this.gl.ARRAY_BUFFER, null);
                this.heights = new e(this, this.gl, this.width, this.height)
            }
            return r.prototype.adjustSize = function() {
                var n, t;
                return t = this.canvas.offsetWidth || 2, n = this.canvas.offsetHeight || 2, this.width !== t || this.height !== n ? (this.gl.viewport(0, 0, t, n), this.canvas.width = t, this.canvas.height = n, this.width = t, this.height = n, this.heights.resize(this.width, this.height)) : void 0
            }, r.prototype.display = function() {
                return this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.quad), this.gl.vertexAttribPointer(0, 4, this.gl.FLOAT, !1, 0, 0), this.heights.nodeFront.bind(0), this.gradientTexture && this.gradientTexture.bind(1), this.shader.use().int("source", 0).int("gradientTexture", 1), this.gl.drawArrays(this.gl.TRIANGLES, 0, 6)
            }, r.prototype.update = function() {
                return this.heights.update()
            }, r.prototype.clear = function() {
                return this.heights.clear()
            }, r.prototype.clamp = function(n, t) {
                return n == null && (n = 0), t == null && (t = 1), this.heights.clamp(n, t)
            }, r.prototype.multiply = function(n) {
                return n == null && (n = .95), this.heights.multiply(n)
            }, r.prototype.blur = function() {
                return this.heights.blur()
            }, r.prototype.addPoint = function(n, t, i, r) {
                return this.heights.addPoint(n, t, i, r)
            }, r
        }();
        window.createWebGLHeatmap = function(n) {
            return new o(n)
        }
    }.call(this);
L.TileLayer.WebGLHeatMap = L.Class.extend({
    options: {
        size: 3e4,
        opacity: 1,
        gradientTexture: !1,
        alphaRange: 1,
        autoresize: !1
    },
    initialize: function(n) {
        this.data = [];
        L.Util.setOptions(this, n)
    },
    onAdd: function(n) {
        var u, f;
        this.map = n;
        var r = n.getSize(),
            i = this.options,
            t = document.createElement("canvas");
        t.id = "webgl-leaflet";
        t.width = r.x;
        t.height = r.y;
        t.style.opacity = i.opacity;
        t.style.position = "absolute";
        n.getPanes().overlayPane.appendChild(t);
        this.WebGLHeatMap = createWebGLHeatmap({
            canvas: t,
            gradientTexture: i.gradientTexture,
            alphaRange: [0, i.alphaRange]
        });
        this.canvas = t;
        n.on("moveend", this._plot, this);
        n.on("zoomstart", this._hide, this);
        n.on("zoomend", this._show, this);
        this.options.autoresize && (f = this, window.onresize = function() {
            window.clearTimeout(u);
            u = window.setTimeout(function() {
                f.resize()
            }, 250)
        });
        this._plot()
    },
    onRemove: function(n) {
        n.getPanes().overlayPane.removeChild(this.canvas);
        n.off("moveend", this._plot, this);
        n.off("zoomstart", this._hide, this);
        n.off("zoomend", this._show, this)
    },
    _hide: function() {
        this.canvas.style.display = "none"
    },
    _show: function() {
        this.canvas.style.display = "block"
    },
    _clear: function() {
        var n = this.WebGLHeatMap;
        n.clear();
        n.display()
    },
    _plot: function() {
        var t, n, r, i;
        if (this.active = !0, t = this.map, n = this.WebGLHeatMap, n.clear(), L.DomUtil.setPosition(this.canvas, t.latLngToLayerPoint(t.getBounds().getNorthWest())), r = this.data.length, r) {
            for (i = 0; i < r; i++) {
                var u = this.data[i],
                    f = new L.LatLng(u[0], u[1]),
                    e = t.latLngToContainerPoint(f);
                n.addPoint(Math.floor(e.x), Math.floor(e.y), this._scale(f), u[2])
            }
            n.update();
            n.display()
        }
    },
    _scale: function(n) {
        var t = this.options.size / 40075017 * 360 / Math.cos(L.LatLng.DEG_TO_RAD * n.lat),
            i = new L.LatLng(n.lat, n.lng - t),
            r = this.map.latLngToLayerPoint(n),
            u = this.map.latLngToLayerPoint(i);
        return Math.max(Math.round(r.x - u.x), 1)
    },
    resize: function() {
        var n = this.map.getSize();
        this.canvas.width = n.x;
        this.canvas.height = n.y;
        this.WebGLHeatMap.adjustSize();
        this._plot()
    },
    addDataPoint: function(n, t, i) {
        this.data.push([n, t, i / 100])
    },
    setData: function(n) {
        this.data = n
    },
    clearData: function() {
        this.data = []
    },
    update: function() {
        this._plot()
    }
});
L.TileLayer.webglheatmap = function(n) {
    return new L.TileLayer.WebGLHeatMap(n)
};
L.TmapCircle = L.Circle.extend({
    options: {
        latlng: null,
        radius: 0,
        styleOptions: {},
        editEnable: !1,
        editIcon: new L.DivIcon({
            iconSize: new L.Point(8, 8),
            className: "tmap-div-icon tmap-editing-icon"
        }),
        editLabelIcon: new L.DivIcon({
            iconSize: new L.Point(50, 20),
            iconAnchor: new L.Point(58, 58),
            className: "tmap-div-icon tmap-editing-icon",
            html: "李根华"
        }),
        editDragStart: function() {},
        editDrag: function() {},
        editDragEnd: function() {}
    },
    initialize: function(n) {
        L.setOptions(this, n);
        L.Path.prototype.initialize.call(this, n.styleOptions);
        this._latlng = L.latLng(n.latlng);
        this._mRadius = n.radius
    },
    onAdd: function(n) {
        L.Path.prototype.onAdd.call(this, n);
        this.options.editEnable && this.addEditHooks()
    },
    onRemove: function(n) {
        this.options.editEnable && this.removeEditHooks();
        L.Path.prototype.onRemove.call(this, n)
    },
    addEditHooks: function() {
        this._map && (this._editMarkerGroup || this._initEditMarkers(), this._map.addLayer(this._editMarkerGroup))
    },
    removeEditHooks: function() {
        this._map && (this._map.removeLayer(this._editMarkerGroup), delete this._editMarkerGroup, delete this._byMarker)
    },
    _initEditMarkers: function() {
        this._editMarkerGroup = new L.layerGroup;
        var n = this.getBounds(),
            i = n.getSouthWest(),
            t = n.getNorthEast(),
            r = new L.LatLng((t.lat + i.lat) / 2, t.lng, !0);
        this._byMarker = this._createEditMarker(r);
        this._editMarkerGroup.addLayer(this._byMarker);
        this._editMarkerGroup.addLayer(this._byMarker.radiusLabelMarker)
    },
    _createEditMarker: function(n) {
        var t = L.marker(n, {
            draggable: !0,
            icon: this.options.editIcon
        });
        t.radiusLabelMarker = L.marker(n, {
            icon: this.options.editLabelIcon
        });
        t.radiusLabelMarker.setOpacity(0);
        t.on("dragstart", this._onbyMarkerMoveStart, this);
        t.on("drag", this._onbyMarkerMove, this);
        t.on("dragend", this._onbyMarkerMoveEnd, this);
        return t
    },
    _onbyMarkerMoveEnd: function(n) {
        var t = n.target;
        t.radiusLabelMarker.setOpacity(0);
        this.options.editDragEnd(this.getLatLng(), this.getRadius())
    },
    _onbyMarkerMoveStart: function() {
        this.options.editDragStart(this.getLatLng(), this.getRadius())
    },
    _onbyMarkerMove: function(n) {
        var t = n.target,
            r = this.getLatLng(),
            u = t._latlng,
            i = r.distanceTo(u);
        this.setRadius(i);
        this.redraw();
        t.radiusLabelMarker && (t.radiusLabelMarker.setOpacity(1), t.radiusLabelMarker.setLatLng(t._latlng), t.radiusLabelMarker._icon.innerHTML = "<p style='color:red;'>" + i + "<\/p>");
        this.fire("radiuschange")
    }
});
L.Marker.include({
    l_rotate: function(n) {
        $(this._icon).find(".div-icon-div").css({
            transform: "rotateZ(" + n + "deg)"
        })
    },
    l_rotate_ms: function(n) {
        $(this._icon).find(".div-icon-div").css({
            "-ms-transform": "rotateZ(" + n + "deg)"
        })
    },
    l_animate: function(n, t) {
        if (t || (t = "jump"), !n) {
            $(this._icon).removeClass("tmap-th-marker-jump");
            $(this._icon).removeClass("tmap-th-marker-swing");
            $(this._icon).find(".div-icon-div").removeClass("tmap-th-marker-rotateX");
            $(this._icon).find(".div-icon-div").removeClass("tmap-th-marker-rotateY");
            $(this._icon).find(".div-icon-div").removeClass("tmap-th-marker-rotateZ");
            $(this._icon).find(".div-icon-div").removeClass("tmap-th-marker-scale");
            return
        }
        return t == "jump" ? $(this._icon).addClass("tmap-th-marker-" + t) : t == "swing" ? $(this._icon).addClass("tmap-th-marker-" + t) : t == "rotateX" ? $(this._icon).find(".div-icon-div").addClass("tmap-th-marker-" + t) : t == "rotateY" ? $(this._icon).find(".div-icon-div").addClass("tmap-th-marker-" + t) : t == "rotateZ" ? $(this._icon).find(".div-icon-div").addClass("tmap-th-marker-" + t) : t == "scale" && $(this._icon).find(".div-icon-div").addClass("tmap-th-marker-" + t), this
    }
});
L.TileLayer.WMTS = L.TileLayer.extend({
    defaultWmtsParams: {
        service: "WMTS",
        request: "GetTile",
        version: "1.0.0",
        layer: "",
        style: "",
        tilematrixSet: "",
        format: "image/jpeg"
    },
    initialize: function(n, t) {
        var i, u, r;
        this._url = n;
        i = L.extend({}, this.defaultWmtsParams);
        u = t.tileSize || this.options.tileSize;
        i.width = t.detectRetina && L.Browser.retina ? i.height = u * 2 : i.height = u;
        for (r in t) this.options.hasOwnProperty(r) || r == "matrixIds" || (i[r] = t[r]);
        this.wmtsParams = i;
        this.matrixIds = t.matrixIds;
        L.setOptions(this, t)
    },
    onAdd: function(n) {
        L.TileLayer.prototype.onAdd.call(this, n)
    },
    getTileUrl: function(n, t) {
        var i = this._map;
        return crs = i.options.crs, tileSize = this.options.tileSize, nwPoint = n.multiplyBy(tileSize), nwPoint.x += 1, nwPoint.y -= 1, sePoint = nwPoint.add(new L.Point(tileSize, tileSize)), nw = crs.project(i.unproject(nwPoint, t)), se = crs.project(i.unproject(sePoint, t)), tilewidth = se.x - nw.x, t = i.getZoom(), ident = this.matrixIds[t].identifier, X0 = this.matrixIds[t].topLeftCorner.lng, Y0 = this.matrixIds[t].topLeftCorner.lat, tilecol = Math.floor((nw.x - X0) / tilewidth), tilerow = -Math.floor((nw.y - Y0) / tilewidth), url = L.Util.template(this._url, {
            s: this._getSubdomain(n)
        }), url + L.Util.getParamString(this.wmtsParams, url) + "&tilematrix=" + ident + "&tilerow=" + tilerow + "&tilecol=" + tilecol
    },
    setParams: function(n, t) {
        return L.extend(this.wmtsParams, n), t || this.redraw(), this
    }
});
L.tileLayer.wtms = function(n, t) {
    return new L.TileLayer.WMTS(n, t)
};
$.tMap = {},
    function() {
        $.extend($.tMap, {
            init: function(n, t) {
                function s() {
                    $.extend(i, {
                        changeTLayer: function(n) {
                            var r, t;
                            if (this.defaultLayer instanceof Array)
                                for (t = 0; t < this.defaultLayer.length; t++) this.removeLayer(this.defaultLayer[t], !0);
                            else this.removeLayer(this.defaultLayer, !0);
                            if (typeof n == "string" ? (r = $.tMap["tileLayer_" + n], this.defaultLayer = r(), i.map.options.crs = $.tMap.tileLayer_crs[n] ? $.tMap.tileLayer_crs[n] : L.CRS.EPSG3857) : typeof n == "function" && (this.defaultLayer = n()), this.defaultLayer instanceof Array)
                                for (t = 0; t < this.defaultLayer.length; t++) this.addLayer(this.defaultLayer[t], !0);
                            else this.addLayer(this.defaultLayer, !0)
                        },
                        print: function() {
                            $("#" + this.containerId).print()
                        }
                    });
                    $.extend(i, {
                        resetView: function() {
                            this.map.setView([r.lat, r.lng], r.zoom)
                        },
                        setView: function(n, t, i, r) {
                            i || (i = this.map.getZoom());
                            this.map.setView([t, n], i, r)
                        },
                        setZoom: function(n, t) {
                            this.map.setZoom(n, t)
                        },
                        zoomIn: function(n, t) {
                            this.map.zoomIn(n, t)
                        },
                        zoomOut: function(n, t) {
                            this.map.zoomOut(n, t)
                        },
                        setZoomAround: function(n, t, i, r) {
                            this.map.setZoomAround([t, n], i, r)
                        },
                        fitBounds: function(n, t) {
                            var r = [],
                                u, i, f;
                            if (typeof n == "string")
                                for (u = n.split(";"), i = 0; i < u.length; i++) f = u[i].split(","), r.push([parseFloat(f[1]), parseFloat(f[0])]);
                            else r = n;
                            this.map.fitBounds(r, t)
                        },
                        fitWorld: function(n) {
                            this.map.fitWorld(n)
                        },
                        panTo: function(n, t, i) {
                            this.map.panTo([t, n], i)
                        },
                        panBy: function(n, t, i) {
                            this.map.panBy([n, t], i)
                        },
                        getCenter: function() {
                            return this.map.getCenter()
                        },
                        getZoom: function() {
                            return this.map.getZoom()
                        },
                        getMinZoom: function() {
                            return this.map.getMinZoom()
                        },
                        getMaxZoom: function() {
                            return this.map.getMaxZoom()
                        },
                        getBounds: function() {
                            return this.map.getBounds()
                        },
                        getBoundsZoom: function() {
                            return this.map.getBoundsZoom()
                        },
                        getSize: function() {
                            return this.map.getSize()
                        },
                        getPixelBounds: function() {
                            return this.map.getPixelBounds()
                        },
                        getPixelOrigin: function() {
                            return this.map.getPixelOrigin()
                        },
                        getRandomLngLat: function() {
                            var t = this.getBounds(),
                                n = t.getSouthWest(),
                                i = t.getNorthEast(),
                                r = i.lng - n.lng,
                                u = i.lat - n.lat;
                            return L.latLng(n.lat + u * Math.random(), n.lng + r * Math.random())
                        },
                        GPSToGoogle: function(n, t) {
                            function a(n, t) {
                                return t < 72.004 || t > 137.8347 ? !0 : n < .8293 || n > 55.8271 ? !0 : !1
                            }

                            function v(n, t) {
                                var r = -100 + 2 * n + 3 * t + .2 * t * t + .1 * n * t + .2 * Math.sqrt(Math.abs(n));
                                return r += (20 * Math.sin(6 * n * i) + 20 * Math.sin(2 * n * i)) * 2 / 3, r += (20 * Math.sin(t * i) + 40 * Math.sin(t / 3 * i)) * 2 / 3, r + (160 * Math.sin(t / 12 * i) + 320 * Math.sin(t * i / 30)) * 2 / 3
                            }

                            function y(n, t) {
                                var r = 300 + n + 2 * t + .1 * n * n + .1 * n * t + .1 * Math.sqrt(Math.abs(n));
                                return r += (20 * Math.sin(6 * n * i) + 20 * Math.sin(2 * n * i)) * 2 / 3, r += (20 * Math.sin(n * i) + 40 * Math.sin(n / 3 * i)) * 2 / 3, r + (150 * Math.sin(n / 12 * i) + 300 * Math.sin(n / 30 * i)) * 2 / 3
                            }
                            var i = 3.1415926535897931,
                                h = 6378245,
                                c = .0066934216229659433,
                                u, f, s;
                            if (a(t, n)) u = t, f = n;
                            else {
                                var e = v(n - 105, t - 35),
                                    o = y(n - 105, t - 35),
                                    l = t / 180 * i,
                                    r = Math.sin(l);
                                r = 1 - c * r * r;
                                s = Math.sqrt(r);
                                e = e * 180 / (h * (1 - c) / (r * s) * i);
                                o = o * 180 / (h / s * Math.cos(l) * i);
                                u = t + e;
                                f = n + o
                            }
                            return {
                                lng: f,
                                lat: u
                            }
                        },
                        getDistance: function(n, t, i, r) {
                            return L.latLng(t, n).distanceTo(L.latLng(r, i))
                        },
                        getDeg: function(n, t, i, r) {
                            var u = i - n,
                                e = r - t,
                                o = Math.sqrt(u * u + e * e),
                                s = u / o,
                                h = Math.acos(s),
                                f = 180 / (Math.PI / h);
                            return t < r && (f = 360 - f), f
                        },
                        getArea: function(n) {
                            function t(n) {
                                var r = n.length,
                                    i = 0,
                                    u = L.LatLng.DEG_TO_RAD,
                                    f, e, t;
                                if (r > 2) {
                                    for (t = 0; t < r; t++) f = n[t], e = n[(t + 1) % r], i += (e.lng - f.lng) * u * (2 + Math.sin(f.lat * u) + Math.sin(e.lat * u));
                                    i = i * 40680631590769 / 2
                                }
                                return Math.abs(i).toFixed(2)
                            }
                            return t(n)
                        }
                    });
                    $.extend(i, {
                        addLayer: function(n, t) {
                            this.map.addLayer(n, t)
                        },
                        removeLayer: function(n) {
                            this.map.removeLayer(n)
                        },
                        hasLayer: function(n) {
                            return this.map.hasLayer(n)
                        },
                        openPopup: function(n, t, i, r) {
                            this.map.openPopup(i, [t, n], r)
                        },
                        closePopup: function(n) {
                            this.map.closePopup(n)
                        },
                        addControl: function() {
                            this.map.addControl(layer)
                        },
                        removeControl: function() {
                            this.map.removeControl(layer)
                        }
                    });
                    $.extend(i, {
                        clear: function() {
                            this.defaultLayerGroup.clearLayers()
                        },
                        addToLayerGroup: function(n) {
                            this.defaultLayerGroup.addLayer(n)
                        },
                        removeFromLayerGroup: function(n) {
                            this.defaultLayerGroup.removeLayer(n)
                        }
                    });
                    $.extend(i, {
                        latLngToLayerPoint: function(n, t) {
                            return this.map.latLngToLayerPoint([t, n])
                        },
                        layerPointToLatLng: function(n, t) {
                            return this.map.layerPointToLatLng([n, t])
                        },
                        containerPointToLayerPoint: function(n, t) {
                            return this.map.containerPointToLayerPoint([n, t])
                        },
                        layerPointToContainerPoint: function(n, t) {
                            return this.map.layerPointToContainerPoint([n, t])
                        },
                        latLngToContainerPoint: function(n, t) {
                            return this.map.latLngToContainerPoint([t, n])
                        },
                        containerPointToLatLng: function(n, t) {
                            return this.map.containerPointToLatLng([n, t])
                        },
                        project: function(n, t, i) {
                            return this.map.project([t, n], i)
                        },
                        unproject: function(n, t, i) {
                            return this.map.unproject([n, t], i)
                        },
                        mouseEventToContainerPoint: function(n) {
                            return this.map.mouseEventToContainerPoint(n)
                        },
                        mouseEventToLayerPoint: function(n) {
                            return this.map.mouseEventToLayerPoint(n)
                        },
                        mouseEventToLatLng: function(n) {
                            return this.map.mouseEventToLatLng(n)
                        }
                    });
                    $.extend(i, {
                        getContainer: function() {
                            return this.map.getContainer()
                        },
                        getPanes: function() {
                            return this.map.getPanes()
                        },
                        whenReady: function(n, t) {
                            this.map.whenReady(n, t)
                        },
                        on: function(n, t) {
                            this.map.on(n, t);
                            return this
                        },
                        off: function(n, t) {
                            return this.map.off(n, t), this
                        }
                    });
                    $.extend(i, {
                        addImageOverLayer: function(n, t) {
                            var i = {
                                l_t: [],
                                r_b: [],
                                options: {},
                                addToMapFlag: !0
                            };
                            $.extend(i, t);
                            var r = n,
                                u = [
                                    [i.l_t[1], i.l_t[0]],
                                    [i.r_b[1], i.r_b[0]]
                                ],
                                f = L.imageOverlay(r, u, i.options);
                            i.addToMapFlag == !0 && this.addToLayerGroup(f)
                        }
                    });
                    $.extend(i, {
                        addLabel: function(n, t, i, r) {
                            function e() {
                                var n = "<p class='before'><\/p><div class='c_text'>";
                                return n += i + "<\/div>", L.divIcon({
                                    iconSize: [0, 0],
                                    iconAnchor: [0, 0],
                                    className: "tmap-th-label",
                                    html: n
                                })
                            }
                            var f = {
                                    anchor: [10, -15],
                                    bgColor: "rgba(0, 0, 0, 0.6)",
                                    bgHoverColor: "rgba(0, 0, 0, 0.9)",
                                    addToMapFlag: !0
                                },
                                u;
                            $.extend(f, r);
                            u = L.marker([t, n], {
                                zIndexOffset: 1e3
                            });
                            u.setIcon(e());
                            u.on("add", function() {
                                $(u._icon).css({
                                    "margin-left": f.anchor[0] + "px",
                                    "margin-top": f.anchor[1] + "px"
                                }).css({
                                    height: "auto",
                                    width: "auto"
                                });
                                f.bgColor != null && ($(u._icon).css({
                                    "background-color": f.bgColor
                                }), $(u._icon).find("p.before").css({
                                    "border-right-color": f.bgColor
                                }));
                                f.bgHoverColor != null && $(u._icon).mouseover(function() {
                                    $(u._icon).css({
                                        "background-color": f.bgHoverColor
                                    });
                                    $(u._icon).find("p.before").css({
                                        "border-right-color": f.bgHoverColor
                                    })
                                }).mouseleave(function() {
                                    $(u._icon).css({
                                        "background-color": f.bgColor
                                    });
                                    $(u._icon).find("p.before").css({
                                        "border-right-color": f.bgColor
                                    })
                                })
                            });
                            return u.m_setText = function(n) {
                                return $(u._icon).find(".c_text").html(n), this
                            }, f.addToMapFlag == !0 && this.addToLayerGroup(u), u
                        },
                        addImgMarker: function(n, t, i) {
                            function e(n, t) {
                                var i = "",
                                    u = "tmap-th-div-icon";
                                return r.needTransition && (u += " tmap-th-transition"), i = "<div class='div-icon-div'><img style='height:100%;width:100%;' src='" + r.icon.iconUrl + "' /><\/div>", L.divIcon({
                                    iconSize: n,
                                    iconAnchor: t,
                                    className: u,
                                    html: i
                                })
                            }
                            var o = this,
                                r = {
                                    icon: {
                                        iconUrl: "",
                                        iconSize: [25, 41],
                                        iconAnchor: [12, 41]
                                    },
                                    option: {},
                                    popupContent: "",
                                    popupOption: {},
                                    needTransition: !1,
                                    addToMapFlag: !0,
                                    routeEnable: !1,
                                    routeState: !1,
                                    routeIndex: 1,
                                    routeArr: [],
                                    routeRotateOffset: 0
                                },
                                u, f;
                            $.extend(r, i);
                            u = L.marker([t, n], r.option);
                            r.routeArr.push([t, n]);
                            u.setIcon(e(r.icon.iconSize, r.icon.iconAnchor));
                            r.popupContent && u.bindPopup(r.popupContent, r.popupOption);
                            if(r.attribute) u.attribute = r.attribute;
                            u.on("add", function() {
                                if (r.sizeOnZoom) u._map.on("zoomend", function() {
                                    if (u._map) {
                                        var n = r.sizeOnZoom(u._map.getZoom());
                                        u.setIcon(e(n.iconSize, n.iconAnchor))
                                    }
                                });
                                if (r.routeEnable) {
                                    r.routeState = !0;
                                    n();

                                    function n() {
                                        var t, i, f;
                                        r.routeState != !1 && (r.routeArr.length > r.routeIndex && (r.routeIndex++, t = r.routeArr[r.routeIndex - 1], i = r.routeArr[r.routeIndex - 2], u.setLatLng(t), f = o.getDeg(i[1], i[0], t[1], t[0]), f != null && u.l_rotate(f + r.routeRotateOffset)), setTimeout(n, 1e3))
                                    }
                                }
                            });
                            u.on("remove", function() {
                                r.routeState = !1
                            });
                            if (r.event)
                                for (f in r.event) u.on(f, r.event[f]);
                            return u.insertRouteItem = function(n, t) {
                                r.routeArr.push([t, n])
                            }, u.needTransition = function(n) {
                                n == !0 ? $(u._icon).addClass("tmap-th-transition") : n == !1 && $(u._icon).removeClass("tmap-th-transition")
                            }, r.addToMapFlag == !0 && this.addToLayerGroup(u), u
                        },
                        addCssMarker: function(n, t, i) {
                            function e() {
                                var n = "",
                                    t = "tmap-th-div-icon",
                                    i, u;
                                return r.needTransition && (t += " tmap-th-transition"), i = [0, 0], u = [r.param_A1.width / 2, r.param_A1.height + 12], n += "<div class='div-icon-div'>", n += "<div class='tmap-th-marker-A1' style='line-height:" + r.param_A1.height + "px;height:" + r.param_A1.height + "px;width:" + r.param_A1.width + "px;'>", n += "<div class='A1_main'>", r.param_A1.iconUrl ? n += "<img src='" + r.param_A1.iconUrl + "' style='height:100%;width:100%;' />" : r.param_A1.iconHtml && (n += r.param_A1.iconHtml), n += "<\/div>", n += "<div class='A1_bottom'>", n += "<\/div>", n += "<\/div>", n += "<\/div>", L.divIcon({
                                    iconSize: i,
                                    iconAnchor: u,
                                    className: t,
                                    html: n
                                })
                            }

                            function o() {
                                var n = "",
                                    t = "tmap-th-div-icon",
                                    i, u;
                                return r.needTransition && (t += " tmap-th-transition"), i = [0, 0], u = [r.param_B1.width / 2, r.param_B1.height / 2], n += "<div class='div-icon-div'>", n += "<div class='tmap-th-marker-B1' style='border-radius:500px;line-height:" + r.param_B1.height + "px;height:" + r.param_B1.height + "px;width:" + r.param_B1.width + "px;'>", n += "<\/div>", n += "<\/div>", L.divIcon({
                                    iconSize: i,
                                    iconAnchor: u,
                                    className: t,
                                    html: n
                                })
                            }

                            function s() {
                                $.extend(u.methodB1, {
                                    changeColor: function(n) {
                                        $.extend(r.param_B1, n);
                                        $(u._icon).find(".tmap-th-marker-B1").css({
                                            "background-color": r.param_B1.bgColor
                                        })
                                    },
                                    changeSize: function(n) {
                                        $.extend(r.param_B1, n);
                                        $(u._icon).css({
                                            "margin-left": "-" + r.param_B1.width / 2 + "px",
                                            "margin-top": "-" + r.param_B1.height / 2 + "px"
                                        }).find(".tmap-th-marker-B1").css({
                                            height: r.param_B1.height + "px",
                                            width: r.param_B1.width + "px"
                                        })
                                    }
                                })
                            }

                            function h() {
                                var n = "",
                                    t = "tmap-th-div-icon",
                                    i, u;
                                return r.needTransition && (t += " tmap-th-transition"), i = [0, 0], u = r.param_C1.iconAnchor, n += "<div class='div-icon-div'>", n += "<div class='tmap-th-marker-C1' style='color:" + r.param_C1.color + ";width:" + r.param_C1.width + "px;'>", n += r.param_C1.text, n += "<\/div>", n += "<\/div>", L.divIcon({
                                    iconSize: i,
                                    iconAnchor: u,
                                    className: t,
                                    html: n
                                })
                            }

                            function c() {
                                $.extend(u.methodC1, {
                                    changeFontSize: function(n) {
                                        $.extend(r.param_C1, n);
                                        $(u._icon).find(".tmap-th-marker-C1").css({
                                            "font-size": r.param_C1.fontSize
                                        })
                                    }
                                })
                            }
                            var f = this,
                                r = {
                                    option: {},
                                    popupContent: "",
                                    popupOption: {},
                                    needTransition: !1,
                                    addToMapFlag: !0,
                                    event: {},
                                    type: "A1",
                                    param_A1: {
                                        height: 30,
                                        width: 30,
                                        bgColor: "rgba(41,125,252,0.9)",
                                        bgHoverColor: "rgba(255,106,0,0.9)"
                                    },
                                    param_B1: {
                                        height: 20,
                                        width: 20,
                                        bgColor: "rgba(41,125,252,0.9)",
                                        bgHoverColor: "rgba(255,106,0,0.9)"
                                    },
                                    param_C1: {
                                        text: "",
                                        color: "#000",
                                        iconAnchor: [0, 0]
                                    }
                                },
                                u;
                            $.extend(r, i);
                            u = L.marker([t, n], r.option);
                            r.type == "A1" ? (u.setIcon(e()), $.extend(r.popupOption, {
                                offset: [0, 0 - (r.param_A1.height + 5)]
                            })) : r.type == "B1" ? u.setIcon(o()) : r.type == "C1" && u.setIcon(h());
                            r.popupContent && u.bindPopup(r.popupContent, r.popupOption);
                            r.type == "A1" ? u.methodA1 = {} : r.type == "B1" ? (u.methodB1 = {}, s()) : r.type == "C1" && (u.methodC1 = {}, c());
                            u.on("add", function() {
                                r.type == "A1" ? ($(u._icon).find(".tmap-th-marker-A1").css({
                                    "background-color": r.param_A1.bgColor
                                }), $(u._icon).find(".A1_bottom").css({
                                    left: (r.param_A1.width - 10) / 2 + "px",
                                    top: r.param_A1.height + "px"
                                }).css({
                                    "border-top-color": r.param_A1.bgColor
                                })) : r.type == "B1" ? $(u._icon).find(".tmap-th-marker-B1").css({
                                    "background-color": r.param_B1.bgColor
                                }) : r.type == "C1" && $(u._icon).css({
                                    width: "auto"
                                })
                            });
                            u.on("mouseover", function() {
                                r.type == "A1" ? ($(u._icon).find(".tmap-th-marker-A1").css({
                                    "background-color": r.param_A1.bgHoverColor
                                }), $(u._icon).find(".A1_bottom").css({
                                    "border-top-color": r.param_A1.bgHoverColor
                                })) : r.type == "B1" && $(u._icon).find(".tmap-th-marker-B1").css({
                                    "background-color": r.param_B1.bgHoverColor
                                })
                            }).on("mouseout", function() {
                                r.type == "A1" ? ($(u._icon).find(".tmap-th-marker-A1").css({
                                    "background-color": r.param_A1.bgColor
                                }), $(u._icon).find(".A1_bottom").css({
                                    "border-top-color": r.param_A1.bgColor
                                })) : r.type == "B1" && $(u._icon).find(".tmap-th-marker-B1").css({
                                    "background-color": r.param_B1.bgColor
                                })
                            });
                            return r.addToMapFlag == !0 && this.addToLayerGroup(u), u.m_addToMap = function() {
                                f.addToLayerGroup(u)
                            }, u.m_removeFromMap = function() {
                                f.removeFromLayerGroup(u)
                            }, u
                        },
                        addLine: function(n, t) {
                            var f = this,
                                r = {
                                    options: $.tMap.utility._cloneJsonObject($.tMap.constant.polyLineOption),
                                    hoverOptions: null,
                                    label: null,
                                    attribute: null,
                                    popupContent: null,
                                    popupOption: {},
                                    addToMapFlag: !0,
                                    event: {}
                                },
                                o, s, h, u, e, i, c;
                            if ($.extend(r, t), o = [], typeof n == "string")
                                for (s = n.split(";"), u = 0; u < s.length; u++) h = s[u].split(","), o.push([parseFloat(h[1]), parseFloat(h[0])]);
                            else if ($.tMap.utility._isArray(n))
                                for (u = 0; u < n.length; u++) e = n[u], typeof e == "string" ? o.push([parseFloat(e.split(",")[1]), parseFloat(e.split(",")[0])]) : o.push([e.lat, e.lng]);
                            i = L.polyline(o, r.options);
                            r.attribute && (i.attribute = r.attribute);
                            r.popupContent && i.bindPopup(r.popupContent, r.popupOption);
                            r.label && (i.hoverLabel = f.addLabel(0, 0, r.label.text, $.extend(r.label, {
                                addToMapFlag: !1
                            })));
                            i.on("mouseover", function() {
                                r.hoverOptions && i.setStyle(r.hoverOptions);
                                i.hoverLabel && f.addToLayerGroup(i.hoverLabel)
                            }).on("mouseout", function() {
                                r.hoverOptions && i.setStyle(r.options);
                                i.hoverLabel && f.removeFromLayerGroup(i.hoverLabel)
                            }).on("mousemove", function(n) {
                                i.hoverLabel && i.hoverLabel.setLatLng(n.latlng)
                            });
                            if (r.event)
                                for (c in r.event) i.on(c, r.event[c]);
                            return i.m_addToMap = function() {
                                f.addToLayerGroup(i)
                            }, i.m_removeFromMap = function() {
                                f.removeFromLayerGroup(i)
                            }, r.addToMapFlag == !0 && f.addToLayerGroup(i), i
                        },
                        addFixed2Line: function(n) {
                            function u() {
                                var n = r.containerPointToLatLng(i.point.x, i.point.y);
                                t.setLatLngs([n, i.latlng])
                            }
                            var r = this,
                                i = {
                                    point: {
                                        x: 0,
                                        y: 0
                                    },
                                    latlng: {
                                        lng: 0,
                                        lat: 0
                                    },
                                    options: {},
                                    attribute: null,
                                    addToMapFlag: !0
                                },
                                f, t;
                            $.extend(i, n);
                            f = $.tMap.utility._cloneJsonObject($.tMap.constant.polyLineOption);
                            $.extend(f, i.options);
                            t = L.polyline([
                                [0, 0],
                                [0, 0]
                            ], f);
                            u();
                            t.on("add", function() {
                                r.on("move", function() {
                                    u()
                                })
                            });
                            return t.l_setPoint = function(n) {
                                i.point = n;
                                u()
                            }, t.l_setLatLng = function(n) {
                                i.latlng = n;
                                u()
                            }, t.l_add = function() {
                                r.addToLayerGroup(t)
                            }, t.l_remove = function() {
                                r.removeFromLayerGroup(t)
                            }, i.addToMapFlag == !0 && r.addToLayerGroup(t), t
                        },
                        addPolygon: function(n, t) {
                            var e = this,
                                r = {
                                    options: $.tMap.utility._cloneJsonObject($.tMap.constant.polygonOption),
                                    hoverOptions: null,
                                    label: null,
                                    attribute: null,
                                    popupContent: null,
                                    popupOption: {},
                                    addToMapFlag: !0,
                                    event: {}
                                },
                                o, s, h, u, f, i, c;
                            if ($.extend(r, t), o = [], typeof n == "string")
                                for (s = n.split(";"), u = 0; u < s.length; u++) h = s[u].split(","), o.push([parseFloat(h[1]), parseFloat(h[0])]);
                            else if ($.tMap.utility._isArray(n))
                                for (u = 0; u < n.length; u++) f = n[u], typeof f == "string" ? o.push([parseFloat(f.split(",")[1]), parseFloat(f.split(",")[0])]) : o.push([f.lat, f.lng]);
                            i = L.polygon(o, r.options);
                            r.attribute && (i.attribute = r.attribute);
                            r.popupContent && i.bindPopup(r.popupContent, r.popupOption);
                            r.label && (i.hoverLabel = e.addLabel(0, 0, r.label.text, $.extend(r.label, {
                                addToMapFlag: !1
                            })));
                            i.on("mouseover", function() {
                                r.hoverOptions && i.setStyle(r.hoverOptions);
                                i.hoverLabel && e.addToLayerGroup(i.hoverLabel)
                            }).on("mouseout", function() {
                                r.hoverOptions && i.setStyle(r.options);
                                i.hoverLabel && e.removeFromLayerGroup(i.hoverLabel)
                            }).on("mousemove", function(n) {
                                i.hoverLabel && i.hoverLabel.setLatLng(n.latlng)
                            });
                            if (r.event)
                                for (c in r.event) i.on(c, r.event[c]);
                            return i.m_addToMap = function() {
                                e.addToLayerGroup(i)
                            }, i.m_removeFromMap = function() {
                                e.removeFromLayerGroup(i)
                            }, r.addToMapFlag == !0 && this.addToLayerGroup(i), i
                        },
                        addRectangle: function(n, t) {
                            var e = this,
                                r = {
                                    options: $.tMap.utility._cloneJsonObject($.tMap.constant.rectangleOption),
                                    hoverOptions: null,
                                    label: null,
                                    attribute: null,
                                    popupContent: null,
                                    popupOption: {},
                                    addToMapFlag: !0,
                                    event: {}
                                },
                                o, s, h, u, f, i, c;
                            if ($.extend(r, t), o = [], typeof n == "string")
                                for (s = n.split(";"), u = 0; u < s.length; u++) h = s[u].split(","), o.push([parseFloat(h[1]), parseFloat(h[0])]);
                            else if ($.tMap.utility._isArray(n))
                                for (u = 0; u < n.length; u++) f = n[u], typeof f == "string" ? o.push([parseFloat(f.split(",")[1]), parseFloat(f.split(",")[0])]) : o.push([f.lat, f.lng]);
                            i = L.rectangle(o, r.options);
                            r.attribute && (i.attribute = r.attribute);
                            r.popupContent && i.bindPopup(r.popupContent, r.popupOption);
                            r.label && (i.hoverLabel = e.addLabel(0, 0, r.label.text, $.extend(r.label, {
                                addToMapFlag: !1
                            })));
                            i.on("mouseover", function() {
                                r.hoverOptions && i.setStyle(r.hoverOptions);
                                i.hoverLabel && e.addToLayerGroup(i.hoverLabel)
                            }).on("mouseout", function() {
                                r.hoverOptions && i.setStyle(r.options);
                                i.hoverLabel && e.removeFromLayerGroup(i.hoverLabel)
                            }).on("mousemove", function(n) {
                                i.hoverLabel && i.hoverLabel.setLatLng(n.latlng)
                            });
                            if (r.event)
                                for (c in r.event) i.on(c, r.event[c]);
                            return i.m_addToMap = function() {
                                e.addToLayerGroup(i)
                            }, i.m_removeFromMap = function() {
                                e.removeFromLayerGroup(i)
                            }, r.addToMapFlag == !0 && this.addToLayerGroup(i), i
                        },
                        addCircle: function(n, t, i, r) {
                            var e = this,
                                f = {
                                    options: $.tMap.utility._cloneJsonObject($.tMap.constant.circleOption),
                                    hoverOptions: null,
                                    label: null,
                                    attribute: null,
                                    popupContent: null,
                                    popupOption: {},
                                    addToMapFlag: !0,
                                    event: {}
                                },
                                u, o;
                            $.extend(f, r);
                            u = L.circle([t, n], i, f.options);
                            f.attribute && (u.attribute = f.attribute);
                            f.popupContent && u.bindPopup(f.popupContent, f.popupOption);
                            f.label && (u.hoverLabel = e.addLabel(0, 0, f.label.text, $.extend(f.label, {
                                addToMapFlag: !1
                            })));
                            u.on("mouseover", function() {
                                f.hoverOptions && u.setStyle(f.hoverOptions);
                                u.hoverLabel && e.addToLayerGroup(u.hoverLabel)
                            }).on("mouseout", function() {
                                f.hoverOptions && u.setStyle(f.options);
                                u.hoverLabel && e.removeFromLayerGroup(u.hoverLabel)
                            }).on("mousemove", function(n) {
                                u.hoverLabel && u.hoverLabel.setLatLng(n.latlng)
                            });
                            if (f.event)
                                for (o in f.event) u.on(o, f.event[o]);
                            return u.m_addToMap = function() {
                                e.addToLayerGroup(u)
                            }, u.m_removeFromMap = function() {
                                e.removeFromLayerGroup(u)
                            }, f.addToMapFlag == !0 && this.addToLayerGroup(u), u
                        }
                    });
                    $.extend(i, {
                        drawLine: function(n) {
                            function c() {
                                i.map.doubleClickZoom.disable();
                                i.on("click", o);
                                i.on("mousemove", s);
                                i.on("dblclick", h)
                            }

                            function o(n) {
                                t.push(n.latlng);
                                t.length == 1 && (r = L.polyline([n.latlng, n.latlng], f.styleOptions), u = L.polyline([n.latlng, n.latlng], f.styleOptions), i.addToLayerGroup(r), i.addToLayerGroup(u));
                                r.addLatLng(n.latlng);
                                u.setLatLngs([n.latlng, n.latlng])
                            }

                            function s(n) {
                                t.length != 0 && u.setLatLngs([t[t.length - 1], n.latlng])
                            }

                            function h() {
                                i.removeFromLayerGroup(u);
                                f.complete(t);
                                l()
                            }

                            function l() {
                                i.off("click", o);
                                i.off("mousemove", s);
                                i.off("dblclick", h);
                                setTimeout(function() {
                                    i.map.doubleClickZoom.enable()
                                }, 100)
                            }
                            var f = {
                                    styleOptions: {
                                        stroke: !0,
                                        color: "blue",
                                        weight: 4,
                                        opacity: .7,
                                        fill: !1,
                                        fillColor: null,
                                        fillOpacity: .2,
                                        clickable: !0
                                    },
                                    begin: function() {},
                                    complete: function() {}
                                },
                                e = {};
                            $.extend(f, n);
                            var r = null,
                                u = null,
                                t = [];
                            return c(), $.extend(e, {
                                line: r,
                                remove: function() {
                                    i.removeFromLayerGroup(r)
                                }
                            }), e
                        },
                        drawPoly: function(n) {
                            function c() {
                                i.map.doubleClickZoom.disable();
                                i.on("click", o);
                                i.on("mousemove", s);
                                i.on("dblclick", h)
                            }

                            function o(n) {
                                t.push(n.latlng);
                                t.length == 1 && (r = L.polygon([n.latlng, n.latlng], f.styleOptions), u = L.polygon([n.latlng, n.latlng], f.styleOptions), i.addToLayerGroup(r), i.addToLayerGroup(u));
                                r.addLatLng(n.latlng);
                                u.setLatLngs([n.latlng, n.latlng])
                            }

                            function s(n) {
                                t.length != 0 && u.setLatLngs([t[t.length - 1], n.latlng])
                            }

                            function h() {
                                i.removeFromLayerGroup(u);
                                f.complete(t);
                                l()
                            }

                            function l() {
                                i.map.doubleClickZoom.enable();
                                i.off("click", o);
                                i.off("mousemove", s);
                                i.off("dblclick", h)
                            }
                            var f = {
                                    styleOptions: {
                                        stroke: !0,
                                        color: "blue",
                                        weight: 4,
                                        opacity: .7,
                                        fill: !0,
                                        fillColor: null,
                                        fillOpacity: .2,
                                        clickable: !0
                                    },
                                    begin: function() {},
                                    complete: function() {}
                                },
                                e = {};
                            $.extend(f, n);
                            var r = null,
                                u = null,
                                t = [];
                            return c(), $.extend(e, {
                                line: r,
                                remove: function() {
                                    i.removeFromLayerGroup(r)
                                }
                            }), e
                        },
                        drawCircle: function(n) {
                            function l() {
                                o.style.cursor = "crosshair";
                                i.map.dragging.disable();
                                i.on("mousedown", s);
                                i.on("mousemove", h);
                                i.on("mouseup", c)
                            }

                            function s(n) {
                                u.begin();
                                r != null && i.removeFromLayerGroup(t);
                                r = n.latlng;
                                t = L.circle(r, .1, u.styleOptions);
                                i.addToLayerGroup(t)
                            }

                            function h(n) {
                                t != null && t.setRadius(n.latlng.distanceTo(r));
                                e.setLatLng(n.latlng)
                            }

                            function c() {
                                u.complete({
                                    lng: r.lng,
                                    lat: r.lat,
                                    radius: t.getRadius()
                                });
                                a()
                            }

                            function a() {
                                i.off("mousedown", s);
                                i.off("mousemove", h);
                                i.off("mouseup", c);
                                i.map.dragging.enable();
                                o.style.cursor = "pointer"
                            }
                            var u = {
                                    onlyOnce: !1,
                                    single: !0,
                                    styleOptions: {
                                        stroke: !0,
                                        color: "blue",
                                        weight: 1,
                                        opacity: .5,
                                        fill: !0,
                                        fillColor: null,
                                        fillOpacity: .2,
                                        clickable: !0
                                    },
                                    addToLayer: null,
                                    begin: function() {},
                                    complete: function() {}
                                },
                                f = {};
                            $.extend(u, n);
                            var t = null,
                                e = this.addLabel(0, 0, "绘制圆形区域", {
                                    anchor: [10, -15]
                                }),
                                r = null,
                                o = i.map.getContainer();
                            return l(), $.extend(f, {
                                circle: t,
                                remove: function() {
                                    i.removeFromLayerGroup(t);
                                    i.removeFromLayerGroup(e)
                                }
                            }), f
                        },
                        drawRectangle: function(n) {
                            function l() {
                                e.style.cursor = "crosshair";
                                i.map.dragging.disable();
                                i.on("mousedown", s);
                                i.on("mousemove", h);
                                i.on("mouseup", c)
                            }

                            function s(n) {
                                var f;
                                t == null ? (t = n.latlng, f = [
                                    [t.lat, t.lng],
                                    [t.lat, t.lng]
                                ], r = L.rectangle(f, u.styleOptions), i.addToLayerGroup(r)) : (i.removeFromLayerGroup(r), t = n.latlng, f = [
                                    [t.lat, t.lng],
                                    [t.lat, t.lng]
                                ], r = L.rectangle(f, u.styleOptions), i.addToLayerGroup(r))
                            }

                            function h(n) {
                                if (r != null) {
                                    var i = [
                                        [t.lat, t.lng],
                                        [n.latlng.lat, n.latlng.lng]
                                    ];
                                    r.setBounds(i)
                                }
                                o.setLatLng(n.latlng)
                            }

                            function c(n) {
                                var i = {},
                                    r = n.latlng;
                                t.lng > r.lng ? (i.min_lng = r.lng, i.max_lng = t.lng) : (i.min_lng = t.lng, i.max_lng = r.lng);
                                t.lat > r.lat ? (i.min_lat = r.lat, i.max_lat = t.lat) : (i.min_lat = t.lat, i.max_lat = r.lat);
                                u.complete(i);
                                a()
                            }

                            function a() {
                                i.off("mousedown", s);
                                i.off("mousemove", h);
                                i.off("mouseup", c);
                                i.map.dragging.enable();
                                e.style.cursor = "pointer"
                            }
                            var u = {
                                onlyOnce: !1,
                                single: !0,
                                styleOptions: {
                                    stroke: !0,
                                    color: "blue",
                                    weight: 1,
                                    opacity: .5,
                                    fill: !0,
                                    fillColor: null,
                                    fillOpacity: .2,
                                    clickable: !0
                                },
                                begin: function() {},
                                complete: function() {}
                            };
                            $.extend(u, n);
                            var f = {},
                                r = null,
                                t = null,
                                e = i.map.getContainer(),
                                o = this.addLabel(0, 0, "绘制矩形区域", {
                                    anchor: [10, -15]
                                });
                            return u.begin(), l(), $.extend(f, {
                                rect: r,
                                remove: function() {
                                    i.removeFromLayerGroup(r);
                                    i.removeFromLayerGroup(o)
                                }
                            }), f
                        }
                    });
                    $.extend(i, {
                        addClusterMarkers: function(n, t) {
                            var r = {
                                    iconCreateFunction: function(n) {
                                        return L.divIcon({
                                            html: n.getAllChildMarkers().length,
                                            className: "tmap-th-cluster",
                                            iconSize: L.point(30, 30)
                                        })
                                    },
                                    maxClusterRadius: 80,
                                    spiderfyOnMaxZoom: !0,
                                    showCoverageOnHover: !0,
                                    zoomToBoundsOnClick: !0,
                                    singleMarkerMode: !1,
                                    disableClusteringAtZoom: null,
                                    removeOutsideVisibleBounds: !0,
                                    animateAddingMarkers: !1,
                                    spiderfyDistanceMultiplier: 1,
                                    chunkedLoading: !1,
                                    chunkInterval: 200,
                                    chunkDelay: 50,
                                    chunkProgress: null,
                                    polygonOptions: {}
                                },
                                u;
                            return $.extend(r, t), r.tIcon && (r.iconCreateFunction = function(n) {
                                if (r.tIcon.type == 1) return _html = "<div class='div-icon-div'><div class='tmap-th-marker-type" + r.tIcon.type + " ", _html += "tmap-th-mark-type1-colorType-" + r.tIcon.colorType + "'>", _html += "<img src='" + r.tIcon.iconUrl + "' />", _html += "<p class='cluster'>" + n.getAllChildMarkers().length + "<\/p>", _html += "<\/div><\/div>", L.divIcon({
                                    iconSize: [30, 40],
                                    iconAnchor: [15, 40],
                                    className: "tmap-th-div-icon",
                                    html: _html
                                });
                                return L.divIcon({
                                    html: n.getAllChildMarkers().length,
                                    className: "tmap-th-cluster",
                                    iconSize: L.point(30, 30)
                                })
                            }), u = new L.MarkerClusterGroup(r), $.each(n, function(n, t) {
                                u.addLayer(t)
                            }), i.addToLayerGroup(u), u
                        },
                        addEllipse: function(n) {
                            var t = {
                                    lng: null,
                                    lat: null,
                                    radii_w: null,
                                    radii_h: null,
                                    radius: 0,
                                    options: null
                                },
                                r;
                            return $.extend(t, n), r = L.ellipse([t.lat, t.lng], [t.radii_w, t.radii_h], t.radius, t.options), i.addToLayerGroup(r), r
                        }
                    });
                    $.extend(i, {
                        toolDistance: function(n) {
                            function y() {
                                v.style.cursor = "hander";
                                i.map.dragging.disable();
                                i.map.doubleClickZoom.disable();
                                p()
                            }

                            function l(n, t, i, r) {
                                return L.marker(n, {
                                    icon: s(t, i, r)
                                })
                            }

                            function s(n, t, i) {
                                return L.divIcon({
                                    className: "tmap_distance",
                                    iconAnchor: i,
                                    iconSize: t ? t : [180, 20],
                                    html: '<div><span style="background-color:rgba(255,255,255,1);padding:2px 3px;font-size:12px; border-radius:5px; border:1px solid #888888; color:#888888;">' + n + "<\/span><\/div>"
                                })
                            }

                            function p() {
                                w();
                                i.on("click", function(n) {
                                    if (!(t.length > 1) || n.latlng.lat != t[t.length - 1].lat)
                                        if (t.push(n.latlng), e.click(t.length, n.latlng), t.length == 1) b(), r.addLayer(l(n.latlng, "起点", null, [30, 30]));
                                        else {
                                            h.setLatLngs(t);
                                            o.setLatLngs([]);
                                            var i = t[t.length - 2],
                                                u = new L.LatLng(n.latlng.lat, n.latlng.lng),
                                                s = new L.LatLng(i.lat, i.lng),
                                                v = parseFloat(s.distanceTo(u));
                                            f = parseFloat(f + v);
                                            c = l(n.latlng, a(f), null, [30, 30]);
                                            r.addLayer(c)
                                        }
                                })
                            }

                            function w() {
                                i.on("mousemove", function(n) {
                                    var i;
                                    if (t.length == 0) {
                                        u.setLatLng(n.latlng);
                                        u.setIcon(s("点击地图标记起点", null, [30, 30]));
                                        return
                                    }
                                    if (i = t[t.length - 1], t.length >= 1) {
                                        o.setLatLngs([i, n.latlng]);
                                        u.setLatLng(n.latlng);
                                        var r = new L.LatLng(n.latlng.lat, n.latlng.lng),
                                            f = new L.LatLng(i.lat, i.lng),
                                            e = parseFloat(f.distanceTo(r));
                                        u.setIcon(s("当前" + a(e), null, [30, 30]))
                                    }
                                })
                            }

                            function b() {
                                i.on("dblclick", function() {
                                    i.off("click");
                                    i.off("mousemove");
                                    i.off("dblclick");
                                    e.clearAfterComplete && i.removeFromLayerGroup(r);
                                    t.length > 1 && (o.setLatLngs([]), u.setLatLng([0, 0]), h.setLatLngs(t), c.setIcon(s("总长:" + a(f), null, [30, 30])), e.complete(f));
                                    i.map.dragging.enable();
                                    i.map.doubleClickZoom.enable()
                                })
                            }

                            function a(n) {
                                return n < 1e3 ? n.toFixed(2) + "米" : (n / 1e3).toFixed(2) + "千米"
                            }
                            var e = {
                                    clearAfterComplete: !1,
                                    click: function() {},
                                    complete: function() {}
                                },
                                v;
                            $.extend(e, n);
                            var t = [],
                                f = 0,
                                r = L.layerGroup();
                            this.addToLayerGroup(r);
                            var h = L.polyline(t, {
                                    color: "#ff0000",
                                    opacity: "0.8",
                                    weight: "3"
                                }),
                                o = L.polyline(t, {
                                    color: "#f68e15",
                                    weight: "3"
                                }),
                                u = l([0, 0], "", null, [0, 10]),
                                c = null;
                            r.addLayer(h);
                            r.addLayer(o);
                            r.addLayer(u);
                            v = i.map.getContainer();
                            y()
                        }
                    })
                }
                var r = {
                        defaultLayer: "th",
                        defaultLayerType: "",
                        lng: 118.79585,
                        lat: 32.03762,
                        zoom: 13,
                        m_param: {}
                    },
                    i, u, e, o, f;
                if ($.extend(r, t), i = {}, i.containerId = n, u = {
                        attributionControl: !1,
                        zoomControl: !1
                    }, $.extend(u, r.m_param), typeof r.defaultLayer == "string" ? (e = $.tMap["tileLayer_" + r.defaultLayer], o = e(r.defaultLayerType), i.defaultLayer = o, $.tMap.tileLayer_crs[r.defaultLayer] && (u.crs = $.tMap.tileLayer_crs[r.defaultLayer])) : typeof r.defaultLayer == "function" && (i.defaultLayer = r.defaultLayer()), i.map = L.map(n, u).setView([r.lat, r.lng], r.zoom), i.defaultLayer instanceof Array)
                    for (f = 0; f < i.defaultLayer.length; f++) i.map.addLayer(i.defaultLayer[f], !0);
                else i.map.addLayer(i.defaultLayer, !0);
                return i.defaultParam = r, i.defaultLayerGroup = L.layerGroup().addTo(i.map), s(), i
            },
            constant: {
                polyLineOption: {
                    stroke: !0,
                    color: "#03f",
                    weight: 5,
                    opacity: 1,
                    fillOpacity: 1
                },
                circleOption: {
                    stroke: !0,
                    color: "#03f",
                    weight: 5,
                    opacity: .5,
                    fillOpacity: .2
                },
                polygonOption: {
                    stroke: !0,
                    color: "#03f",
                    weight: 5,
                    opacity: .5,
                    fillOpacity: .2
                },
                rectangleOption: {
                    stroke: !0,
                    color: "#03f",
                    weight: 5,
                    opacity: .5,
                    fillOpacity: .2
                }
            },
            utility: {
                _isArray: function(n) {
                    return Object.prototype.toString.call(n) === "[object Array]"
                },
                _cloneJsonObject: function(n) {
                    var i = {},
                        t;
                    for (t in n) i[t] = n[t];
                    return i
                },
                _getSiteBasePath: function() {
                    var t = window.document.location.href,
                        n = window.document.location.pathname,
                        i = t.indexOf(n),
                        r = t.substring(0, i),
                        u = n.substring(0, n.substr(1).indexOf("/") + 1);
                    return r + u
                },
                _getFunction: function(n, t) {
                    for (var i = window, u = (n || "").split("."), r = 0; r < u.length; r++) {
                        if (!i) return null;
                        u[r] != "window" && (i = i[u[r]], alert(i.toString()))
                    }
                    return typeof i == "function" ? i : (t.push(n), Function.constructor.apply(null, t))
                },
                _hefei_crs: function() {
                    return new L.Proj.CRS("EPSG:21460", "+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=15.8,-154.4,-82.3,0,0,0,0 +units=m +no_defs", {
                        origin: [259950, 3842516.87],
                        resolutions: [2328.30625, 1164.153125, 582.0765625, 291.03828125, 145.519140625, 72.7595703125, 36.37978515625, 18.189892578125, 9.0949462890625, 4.54747314453125, 2.2737365722656251, 1.1368682861328125, .56843414306640627, .28421707153320314, .14210853576660157]
                    })
                }
            }
        })
    }(jQuery),
    function() {
        $.extend($.tMap, {
            SitePath: $.tMap.utility._getSiteBasePath(),
            tileLayer_crs: {
                tianditu_WTMS_jwd: L.CRS.EPSG4326,
                tianditu_wx_WTMS_jwd: L.CRS.EPSG4326,
                tianditu_dx_WTMS_jwd: L.CRS.EPSG4326
            }
        })
    }(jQuery),
    function() {
        $.extend($.tMap, {
            tileLayer_th: function() {
                return L.tileLayer("http://www.tuhuitech.com:18080{url}.png", {
                    minZoom: 7,
                    maxZoom: 17,
                    url: function(n) {
                        return $.tMap.map_url_th(n)
                    }
                })
            },
            tileLayer_google: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=m@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo", {
                    subdomains: "123",
                    maxZoom: 22
                })
            },
            tileLayer_google_max: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=m@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo&style=2", {
                    subdomains: "123",
                    maxZoom: 22
                })
            },
            tileLayer_google_s: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=s@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo", {
                    subdomains: "123",
                    maxZoom: 20
                })
            },
            tileLayer_google_r: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=r@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo", {
                    subdomains: "123",
                    maxZoom: 22
                })
            },
            tileLayer_google_h: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=h@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo", {
                    subdomains: "123",
                    maxZoom: 22
                })
            },
            tileLayer_google_sh: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=s@177000000,h@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo", {
                    subdomains: "123",
                    maxZoom: 20
                })
            },
            tileLayer_google_sh_max: function() {
                return L.tileLayer("http://mt{s}.google.cn/vt/lyrs=s@177000000,h@177000000&hl=zh-CN&gl=cn&src=app&x={x}&y={y}&z={z}&s=Galileo&style=2", {
                    subdomains: "123",
                    maxZoom: 22
                })
            },
            tileLayer_sina: function() {
                return L.tileLayer(" http://dituapi.iask.com:8080/mapabc/maptile?v=w2.61&z={z}&x={x}&y={y}", {
                    maxZoom: 18
                })
            },
            tileLayer_qq: function() {
                return L.tileLayer(" http://dituapi.iask.com:8080/mapabc/maptile?v=w2.61&z={z}&x={x}&y={y}", {
                    maxZoom: 22
                })
            },
            tileLayer_baidu: function() {
                return L.tileLayer("http://online{s}.map.bdimg.com/tile/?qt=tile&{url}&styles=pl&udt=20130712", {
                    subdomains: "01234",
                    maxZoom: 17,
                    minZoom: 2,
                    url: function(n) {
                        return $.tMap.map_url_baidu(n)
                    }
                })
            },
            tileLayer_bing: function() {
                return L.tileLayer("http://t{s}.tiles.ditu.live.com/tiles/r{url}.png?g=102&mkt=zh-cn&n=z", {
                    maxZoom: 17,
                    subdomains: "0123",
                    url: function(n) {
                        return $.tMap.map_url_bing(n)
                    }
                })
            },
            tileLayer_autonavi: function() {
                return L.tileLayer("http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}", {
                    subdomains: "1234",
                    maxZoom: 18
                })
            },
            tileLayer_autonavi_max: function() {
                return L.tileLayer("http://webst0{s}.is.autonavi.com/appmaptile?style=7&x={x}&y={y}&z={z}", {
                    subdomains: "1234",
                    maxZoom: 20
                })
            },
            tileLayer_autonavi_wx: function() {
                return L.tileLayer("http://webst0{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}", {
                    subdomains: "1234",
                    maxZoom: 18
                })
            },
            tileLayer_autonavi_bj: function() {
                return L.tileLayer("http://webst0{s}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}", {
                    subdomains: "1234",
                    maxZoom: 18
                })
            },
            tileLayer_tianditu: function() {
                return [L.tileLayer("http://t{s}.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                }), L.tileLayer("http://t{s}.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                })]
            },
            tileLayer_tianditu_jwd: function() {
                return [L.tileLayer("http://t{s}.tianditu.com/DataServer?T=vec_c&x={x}&y={y}&l={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                }), L.tileLayer("http://t{s}.tianditu.com/DataServer?T=cva_c&x={x}&y={y}&l={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                })]
            },
            tileLayer_tianditu_wx: function() {
                return [L.tileLayer("http://t{s}.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                }), L.tileLayer("http://t{s}.tianditu.com/DataServer?T=cia_w&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                })]
            },
            tileLayer_tianditu_wx_jwd: function() {
                return [L.tileLayer("http://t{s}.tianditu.com/DataServer?T=img_c&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                }), L.tileLayer("http://t{s}.tianditu.com/DataServer?T=cia_c&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                })]
            },
            tileLayer_tianditu_dx: function() {
                return [L.tileLayer("http://t{s}.tianditu.com/DataServer?T=ter_w&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                }), L.tileLayer("http://t{s}.tianditu.com/DataServer?T=cta_w&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                })]
            },
            tileLayer_tianditu_dx_jwd: function() {
                return [L.tileLayer("http://t{s}.tianditu.com/DataServer?T=ter_c&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                }), L.tileLayer("http://t{s}.tianditu.com/DataServer?T=cta_c&X={x}&Y={y}&L={z}", {
                    subdomains: "01234567",
                    maxZoom: 18
                })]
            },
            tileLayer_tianditu_WTMS: function() {
                for (var t = new Array(22), n = 0; n < 22; n++) t[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(20037508, -20037508)
                };
                return [L.tileLayer.wtms("http://t{s}.tianditu.cn/vec_w/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "vec",
                    tilematrixSet: "w",
                    matrixIds: t,
                    format: "tiles"
                }), L.tileLayer.wtms("http://t{s}.tianditu.cn/cva_w/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "cva",
                    tilematrixSet: "w",
                    matrixIds: t,
                    format: "tiles"
                })]
            },
            tileLayer_tianditu_WTMS_jwd: function() {
                for (var t = new Array(22), n = 0; n < 22; n++) t[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(90, -180)
                };
                return [L.tileLayer.wtms("http://t{s}.tianditu.cn/vec_c/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "vec",
                    tilematrixSet: "c",
                    matrixIds: t,
                    format: "tiles"
                }), L.tileLayer.wtms("http://t{s}.tianditu.cn/cva_c/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "cva",
                    tilematrixSet: "c",
                    matrixIds: t,
                    format: "tiles"
                })]
            },
            tileLayer_tianditu_wx_WTMS: function() {
                for (var t = new Array(22), n = 0; n < 22; n++) t[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(20037508, -20037508)
                };
                return [L.tileLayer.wtms("http://t{s}.tianditu.cn/img_w/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "img",
                    tilematrixSet: "w",
                    matrixIds: t,
                    format: "tiles"
                }), L.tileLayer.wtms("http://t{s}.tianditu.cn/cia_w/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "cia",
                    tilematrixSet: "w",
                    matrixIds: t,
                    format: "tiles"
                })]
            },
            tileLayer_tianditu_wx_WTMS_jwd: function() {
                for (var i = new Array(22), t, n = 0; n < 22; n++) i[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(20037508, -20037508)
                };
                for (t = new Array(22), n = 0; n < 22; n++) t[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(90, -180)
                };
                return [L.tileLayer.wtms("http://t{s}.tianditu.cn/img_c/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "img",
                    tilematrixSet: "c",
                    matrixIds: t,
                    format: "tiles"
                }), L.tileLayer.wtms("http://t{s}.tianditu.cn/cia_c/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "cia",
                    tilematrixSet: "c",
                    matrixIds: t,
                    format: "tiles"
                })]
            },
            tileLayer_tianditu_dx_WTMS: function() {
                for (var t = new Array(22), n = 0; n < 22; n++) t[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(20037508, -20037508)
                };
                return [L.tileLayer.wtms("http://t{s}.tianditu.cn/ter_w/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "ter",
                    tilematrixSet: "w",
                    matrixIds: t,
                    format: "tiles"
                }), L.tileLayer.wtms("http://t{s}.tianditu.cn/cta_w/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "cta",
                    tilematrixSet: "w",
                    matrixIds: t,
                    format: "tiles"
                })]
            },
            tileLayer_tianditu_dx_WTMS_jwd: function() {
                for (var i = new Array(22), t, n = 0; n < 22; n++) i[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(20037508, -20037508)
                };
                for (t = new Array(22), n = 0; n < 22; n++) t[n] = {
                    identifier: "" + n,
                    topLeftCorner: new L.LatLng(90, -180)
                };
                return [L.tileLayer.wtms("http://t{s}.tianditu.cn/ter_c/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "ter",
                    tilematrixSet: "c",
                    matrixIds: t,
                    format: "tiles"
                }), L.tileLayer.wtms("http://t{s}.tianditu.cn/cta_c/wmts", {
                    maxZoom: 18,
                    minZoom: 7,
                    subdomains: "01234567",
                    style: "default",
                    layer: "cta",
                    tilematrixSet: "c",
                    matrixIds: t,
                    format: "tiles"
                })]
            },
            map_url_th: function(n) {
                function i(n, t, i) {
                    var u = 1,
                        r;
                    if (n > 9 && (u = n > 11 ? n.toString().length : 2), r = t - u, r > 0) {
                        while (r > 0) i = i + "0", r--;
                        i = i + "" + n
                    } else i = i + "" + n;
                    return i
                }
                var u = n.z,
                    f = n.x,
                    e = Math.pow(2, u) - n.y - 1,
                    h = u / 2,
                    r = 2 << h,
                    t = 1,
                    o, s;
                return r > 10 && (t = Math.ceil(Math.floor(Math.log(r) / Math.log(10)) + 1)), o = Math.floor(f / r), s = Math.floor(e / r), "/EPSG_900913_" + i(u, 2, "") + "/" + i(o, t, "") + "_" + i(s, t, "") + "/" + i(f, 2 * t, "") + "_" + i(e, 2 * t, "")
            },
            map_url_baidu_ags_row: [
                [0, 0],
                [1, 0],
                [3, 1],
                [6, 3],
                [13, 6],
                [26, 12],
                [52, 24],
                [105, 49],
                [210, 98],
                [421, 197],
                [843, 395],
                [1685, 790],
                [3372, 1581],
                [6744, 3163],
                [13489, 6327],
                [26979, 12654],
                [53958, 25308],
                [107917, 50617]
            ],
            map_url_baidu_ags_col: [
                [0, 0],
                [0, 0],
                [1, 0],
                [2, 1],
                [5, 2],
                [12, 4],
                [24, 9],
                [48, 18],
                [97, 36],
                [194, 73],
                [387, 147],
                [776, 294],
                [1551, 589],
                [3103, 1178],
                [6207, 2356],
                [12415, 4712],
                [24830, 9425],
                [49661, 18851]
            ],
            map_url_baidu: function(n) {
                var u = n.z + 1,
                    t = this.map_url_baidu_ags_row[n.z],
                    i = this.map_url_baidu_ags_col[n.z],
                    f = n.x + parseInt(t[1]) - parseInt(t[0]),
                    e = parseInt(i[0]) + parseInt(i[1]) - n.y;
                return "x=" + f + "&y=" + e + "&z=" + u;
                var o, r, s
            },
            map_url_bing: function(n) {
                function t(n, t, i) {
                    for (var e = "", r, f, u = i; u > 0; u--) r = 0, f = 1 << u - 1, (n & f) != 0 && r++, (t & f) != 0 && (r++, r++), e += r.toString();
                    return e
                }
                return t(n.x, n.y, n.z)
            }
        })
    }(jQuery)
